Forum Discussion

Daretoexplore's avatar
Daretoexplore
Advocate I
6 months ago
Solved

Random question

Hi all   I have a weird situation, and Im not sure how to tackle it.   My data is as follows:   Name.                Category.        Date Anne Other.        Banana.          1st Feb Anne Oth...
  • cengizhanarslan's avatar
    6 months ago

    You could create a calculated column as below:

    Is Latest Row =
    VAR CurrName = 'Table'[Name]
    VAR CurrCat  = 'Table'[Category]
    VAR CurrDate = 'Table'[Date]
    VAR MaxDateForPair =
        CALCULATE (
            MAX ( 'Table'[Date] ),
            FILTER (
                ALL ( 'Table' ),
                'Table'[Name] = CurrName && 'Table'[Category] = CurrCat
            )
        )
    RETURN
    IF ( CurrDate = MaxDateForPair, 1, 0 )