Forum Discussion
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!
Anonymous - 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])
3 Replies
- Greg_DecklerCommunity Champion
Anonymous - 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])- AnonymousNot applicable
Thanks! it worked great. I just changed the "ALL" to "ALLSELECTED" for filtering purposes.
- amitchandakSuper User
Anonymous , plot this measure with date
lastnonblankvalue(table[timestamp], max(Table[Value]))
Date = [timestamp].date