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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

add unique values based on the most recent date

I have a table with keys, values and dates.
I need to filter the unique keys according to the most recent date and thus use the corresponding value.

 

KeyValueDate
AAAA8025/01/2019
AAAA3119/06/2019
BBBB4230/07/2020
BBBB9017/02/2020
AAAA2928/06/2019
CCCC3808/01/2020
DDDD4222/08/2020
BBBB5623/11/2020
EEEE7024/09/2019

 

So I need to be able to make a table appearance, with date reference, with the values and the sum.

 

KeyValue
AAA29
BBBB56
CCCC38
DDDD42
EEEE70
total235

 

Can someone help me?

3 REPLIES 3
mahoneypat
Microsoft Employee
Microsoft Employee

Please try this expression in your measure.

 

Latest Value = LASTNONBLANKVALUE(Data[Date], MAX(Data[Value]))
 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Greg_Deckler
Community Champion
Community Champion

@Anonymous - Use Lookup Min/Max - https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434



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...
Anonymous
Not applicable

Thanks for the answer, but in fact I don't want to add them all up, I just want the most recent result for duplicate lines, ignoring the one with the oldest reference.

luguilherme_0-1597270060998.png

In addition to adding it all up, the column total does not reflect the total rows 😞

 

luguilherme_1-1597270087401.png

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.