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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Create New Column with RANKX DAX for ranking by multiple variable

Hi All, 

 

I would like to create new column (Rank) using RANKX, this rank coloumn is group by multiple criteria (Type 1, Type 2, Month, and Year) then rank by the score. below are the sample of my table. 

 

Type 1Type 2MonthyearScoreRank
AAAJAN20231001
AABJAN2023101
AABFEB20231001
AAAFEB20232002
AAAFEB20233001
BBBMAR20231001
BBBMAR2023502
BBAFEB2023601
BBAFEB2023302
CCCFEB2023402
CCCFEB20231001
CCCJAN2023901
CCDMAR2023801
CCEMAR2023701
DDEJAN2023502
DDDJAN2023452
DDDJAN2023671
DDEJAN2023991

 

anyone have using RANKX function for this use case ? appreciate much of your help. 

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

Rnk = 
COUNTROWS(
    FILTER(
        DATA,
        DATA[Type 1] = EARLIER( DATA[Type 1] )
            && DATA[Type 2] = EARLIER( DATA[Type 2] )
            && DATA[year] = EARLIER( DATA[year] )
            && DATA[Month] = EARLIER( DATA[Month] )
            && DATA[Score] >= EARLIER( DATA[Score] )
    )
)

ThxAlot_0-1690189018772.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

3 REPLIES 3
ThxAlot
Super User
Super User

Rnk = 
COUNTROWS(
    FILTER(
        DATA,
        DATA[Type 1] = EARLIER( DATA[Type 1] )
            && DATA[Type 2] = EARLIER( DATA[Type 2] )
            && DATA[year] = EARLIER( DATA[year] )
            && DATA[Month] = EARLIER( DATA[Month] )
            && DATA[Score] >= EARLIER( DATA[Score] )
    )
)

ThxAlot_0-1690189018772.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Anonymous
Not applicable

This is working ! thank you very much!

mlsx4
Memorable Member
Memorable Member

Hi @Anonymous 

 

This should work:

 

sumSC= SUM(Table[Score])

RANX Total= 
RANKX(
ALLEXCEPT('Table','Table'[Type 1],'Table'[Type 2],'Table'[Month],'Table'[year]),[sumSc],,DESC
)

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 Kudoed Authors