Forum Discussion

alexbjorlig's avatar
alexbjorlig
Helper IV
4 years ago
Solved

How to group table by date

I'm new to DAX, and need to find the latest value by date in a measure.   Input:   category     date value1 value2 A 3/3/2020 04:30:00 1 0 A 2/1/2020 04:30:00 0 1 A 1/1/2020...
  • Fowmy's avatar
    4 years ago

    alexbjorlig 

    Try this table, it will work for any number of columns in your table

     

    New Table  = 
    
    FILTER(
        table,
        VAR __cat = Table[category    ] RETURN 
        Table[date] = CALCULATE( MAX(Table[date]) , REMOVEFILTERS() , Table[category    ] = __cat)
    
    )