Skip to main content
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
kendomino
New Contributor

How to filter a visual to only show the latest rows based on dataLake_CreatedTime

Body:
Iโ€™m working with a snapshot table in Power BI that refreshes frequently. The table has multiple rows for the same record ID, each with a different dataLake_CreatedTime (datetime) showing when that snapshot was created.

What I need:

  • For any given record ID, my visual should only show the row(s) with the most recent dataLake_CreatedTime.

  • If there are multiple records tied for the latest timestamp, I only want one of them shown in the visual.

Details:

  • Table name: api_openreqs

  • Key fields:

    • JobReq_JobReqID (text) โ€” may contain duplicates because of multiple snapshots

    • dataLake_CreatedTime (datetime) โ€” snapshot creation timestamp

  • Goal: Limit visuals to one latest row per JobReq_JobReqID based on the maximum dataLake_CreatedTime.

What Iโ€™ve tried:

  • Using MAX in a measure to find the latest date per ID

  • Creating a calculated column to flag the latest row

  • Running into issues with ties and overcounting

Question:
Whatโ€™s the best way (measure, calculated column, or Power Query transformation) to configure my data so that visuals always filter to only the latest rows based on dataLake_CreatedTime? 

3 REPLIES 3
Greg_Deckler
Esteemed Contributor III

@kendomino Sounds like you need a Complex Selector: https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/The-Complex-Selector/m-p/1116633#M5...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
kendomino
New Contributor

Hi @Greg_Deckler , thanks for the proposal, but thatโ€™s not quite what Iโ€™m looking for. I need my card visualization to show only the most recently updated dataโ€”specifically, the latest JobReq_JobReqId based on the DataLake_createdtime field. Iโ€™ve attached a screenshot for context.

kendomino_0-1755111207386.png

kendomino_0-1755111386788.png

 

Greg_Deckler
Esteemed Contributor III

@kendomino So that's what I call a double lookup. It looks something like the following:

Measure =
  VAR __Table = ALLSELECTED( 'Table' )
  VAR __MaxDate = MAXX( __Table, [DataLake_createdtime] )
  VAR __Result = MAXX( FILTER( __Table, [DataLake_createdtime] = __MaxDate ), [JobReq_JobReqId )
RETURN
  __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Users online (27)