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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.