Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Last date dax

Hi experts, I want to filter records based on the date filed dynamically , when the user will select any of the month, then I want to show the data accordingly. Please help   Date                ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    HI Anonymous,

    You can create a measure formula to get the last date based on group and compare with current row date to return flag, then you can use this on ‘visual level filter’ to filter records:

    formula =
    VAR _lastdate =
        CALCULATE ( MAX ( Table[Date] ), ALLSELECTED ( Table ), VALUES ( Table[Type] ) )
    VAR currdate =
        MAX ( Table[Date] )
    RETURN
        IF ( currdate = _lastdate, "Y", "N" )

    Regards,

    Xiaoxin Sheng