Forum Discussion
harryfasb6000
6 years agoFrequent Visitor
How do I get Max Timestamp for Each Day using DAX
I have a table that updates 1-3x a day. Does anyone know how I can return only the max timestamp for each day using DAX. Thanks.
You could use this formula to create a column
Column = CALCULATE(MAX('Table'[Datetime]),FILTER('Table',FORMAT([Datetime],"yyyy/MM/dd")=FORMAT(EARLIER([Datetime]),"yyyy/MM/dd")))or use this formula to create a measure
Measure = CALCULATE(MAX('Table'[Datetime]),FILTER(ALLSELECTED('Table'),FORMAT([Datetime],"yyyy/MM/dd")=FORMAT(SELECTEDVALUE('Table'[Datetime]),"yyyy/MM/dd")))Regards,
Lin
5 Replies
- AnonymousNot applicableTry this
IF(CALCULATE(MAX(Table1[date]),ALLEXCEPT(Table1,Table1[date]))=MAX(Table1[date]),1,0)
And add this measure to visual level filter ans set it to 1.- harryfasb6000Frequent Visitor
Thanks. Tried that but couldnt get to work. Do I need to split the column into two ... date, time?
- AnonymousNot applicableYes that will make it much easier.
- v-lili6-msftCommunity Support
You could use this formula to create a column
Column = CALCULATE(MAX('Table'[Datetime]),FILTER('Table',FORMAT([Datetime],"yyyy/MM/dd")=FORMAT(EARLIER([Datetime]),"yyyy/MM/dd")))or use this formula to create a measure
Measure = CALCULATE(MAX('Table'[Datetime]),FILTER(ALLSELECTED('Table'),FORMAT([Datetime],"yyyy/MM/dd")=FORMAT(SELECTEDVALUE('Table'[Datetime]),"yyyy/MM/dd")))Regards,
Lin