Search code examples
powerbidaxdata-analysispowerbi-desktopdata-cleaning

DAX Calc. Column with true/false entry only in latest instance per category


I would need the fourth, calculated column, to the below ex. table. Category is 'case' and entry is in the latest 'date' record per category, based on the 'result' from the latest 'date'

enter image description here

Thanks!


Solution

  • final result = 
    
     VAR tbl = CALCULATETABLE('Table', ALLEXCEPT('Table', 'Table'[case]))
     VAR maxDate = MAXX(tbl, 'Table'[date])
    
     RETURN 
     IF('Table'[date] = maxDate,
        CONCATENATEX( 
            FILTER(tbl,  'Table'[date] = maxDate), 'Table'[result]
        ), ""
    )
    

    enter image description here