Forum Discussion

harryfasb6000's avatar
harryfasb6000
Frequent Visitor
6 years ago
Solved

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.  
  • v-lili6-msft's avatar
    6 years ago

    hi  harryfasb6000 

    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