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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rnian18
Helper II
Helper II

Get last text value by date

I have a very simple problem, but it seems like all the answers so far on the forums are very complicated.  I wanted to make the code as simple as possible.

 

Basically, I have a table of two columns.  First is dates in the following format: ss:mm:dd:mm:yyyy.  Second is TRUE/FALSE values.  I just want a measure or a way to get the TRUE/FALSE value corresponding to the last time stamp.

 

For example, I have July 20th, 21st, 22nd.  And the corresponding TRUE/FALSE is TRUE, FALSE, TRUE.  In this case, I want to return TRUE because July 22nd is the latest date.

 

Thanks!

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@rnian18 - You basically want Lookup Min/Max - https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434

 

Basically,

Measure =
  VAR __maxDate = MAXX(ALL('Table'[Date]),[Date])
RETURN
  MAXX(FILTER('Table',[Date]=__maxDate),[truefalse])


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...

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@rnian18 , plot this measure with date

lastnonblankvalue(table[timestamp], max(Table[Value]))

 

Date = [timestamp].date

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Greg_Deckler
Community Champion
Community Champion

@rnian18 - You basically want Lookup Min/Max - https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434

 

Basically,

Measure =
  VAR __maxDate = MAXX(ALL('Table'[Date]),[Date])
RETURN
  MAXX(FILTER('Table',[Date]=__maxDate),[truefalse])


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...

Thanks! it worked great.  I just changed the "ALL" to "ALLSELECTED" for filtering purposes.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors