Forum Discussion

AOSulli's avatar
AOSulli
Frequent Visitor
2 years ago
Solved

Calculated column to flag max count per category and dates per category after the date associated

hello - i am looking to create a calculated column that flags the max count per title and any date after the max count per title date in the same title group. I cannot figure how to do this. 

 

Title           Count    AssignmentDate

Course 21611/01/2024
Course 2112/01/2024
Course 4111/12/2023
Course 41229/01/2024
Course 4424/01/2024
Course 4210/11/2023
Course 4123/01/2024
Course 4112/01/2024
Course 4112/12/2023
Course 4319/01/2024
Course 4103/01/2024
Course 5107/09/2023
Course 7124/01/2024
Course 7319/01/2024
Course 7112/01/2024
Course 7117/01/2024
Course 7103/01/2024
Course 6119/10/2023
Course 1114/12/2023
Course 31225/01/2024

 

and this is what i woudl like to see - 

thank you for your help!

  • Hi,

    Please use this formula:

    "

    VAR __MaxCount =
    CALCULATE(
        MAX(T_CalColumn[Count]),
        ALLEXCEPT(T_CalColumn,T_CalColumn[Title])
    )

    VAR __DateMaxCount =
    CALCULATE(
        MAX(T_CalColumn[AssignmentDate]),
        FILTER(
                ALLEXCEPT(T_CalColumn,T_CalColumn[Title]),
                T_CalColumn[Count]=__MaxCount
        )
    )
    VAR __Result =
        IF(
            [AssignmentDate]>__DateMaxCount || [Count]=__MaxCount,
             "Y"
        )

    RETURN
    __Result
    Final result should be this: 

     

1 Reply

  • _AAndrade's avatar
    _AAndrade
    Icon for Resident Rockstar rankResident Rockstar

    Hi,

    Please use this formula:

    "

    VAR __MaxCount =
    CALCULATE(
        MAX(T_CalColumn[Count]),
        ALLEXCEPT(T_CalColumn,T_CalColumn[Title])
    )

    VAR __DateMaxCount =
    CALCULATE(
        MAX(T_CalColumn[AssignmentDate]),
        FILTER(
                ALLEXCEPT(T_CalColumn,T_CalColumn[Title]),
                T_CalColumn[Count]=__MaxCount
        )
    )
    VAR __Result =
        IF(
            [AssignmentDate]>__DateMaxCount || [Count]=__MaxCount,
             "Y"
        )

    RETURN
    __Result
    Final result should be this: