Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
AOSulli
Frequent Visitor

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 - 

AOSulli_0-1709135196176.png

thank you for your help!

1 ACCEPTED SOLUTION
_AAndrade
Super User
Super User

Hi,

Please use this formula:

_AAndrade_0-1709137778477.png

"

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: 
_AAndrade_1-1709137824910.png

 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

1 REPLY 1
_AAndrade
Super User
Super User

Hi,

Please use this formula:

_AAndrade_0-1709137778477.png

"

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: 
_AAndrade_1-1709137824910.png

 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors