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! Learn more

Reply
Anonymous
Not applicable

Filter Group While Using Rankx

Hi Everyone,

 

Its a very simple query but I am not able to get the results or not able to find the logic. I want filter some values from group to give the ranking.

 Raw Data

 

 

GroupItemValueRank
Oneitem17781
Oneitem26172
Oneitem35403
ThreeItem48472
ThreeItem68731
ThreeItem97813
Twoitem85123
TwoItem107851
Twoitem56232

 

Further I used Rankx to calcualte the group wise rank

 

RankXDescMeasure2 = 
    RANKX(
        ALL('Table'[Group]),
        CALCULATE(
            SUM('Table'[Value])
        ),
        ,
        DESC
    )

 

GroupValueRank1
One19352
Three25011
Two19203

 

How would I filter one or two or three and give a new rank like below:

GroupValueRank1
Three25011
Two19202

 

 

Please help !

 

Regards

Uphar

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, Thanks it works..

 

If you could also help me with Month on Month Rank change DAx.. My rank is changing month on month basis for same group.

 

I want to check the Rank difference of this month to last month  (Trend)

 

Last Month Ranking

MonthUnitDivison Ranking checkAverage of Star Rating
FebGroup1213
FebGroup1122.76
FebGroup1032.62
FebGroup942.57
FebGroup852.36
FebGroup762.33
Feb 72.29
FebGroup582.22
FebGroup492.11
Feb 102.06
FebGroup1112
FebGroup2111.95
FebGroup3121.8
FebTBA13 

 

This month ranking

MonthUnitDivison Ranking checkTrend
MarGroup121312
MarGroup1175
MarGroup1041
MarGroup93-1
MarGroup83-2
MarGroup73-3
Mar 4-3
MarGroup5102
MarGroup42-7
Mar 9-1
MarGroup19-2
MarGroup28-3
MarGroup39-3
MarTBA4-9

 

Tend is representing this month to last month rank difference.. I am new in powerbi so not able to apply the Time intellegence function.. I believe you can answer this question too..

 

Regards

Uphar

View solution in original post

3 REPLIES 3
Pragati11
Super User
Super User

HI @Anonymous ,

 

You will have to modify your dax something as below:

RankXDescMeasure2 = 
    RANKX(
        FILTER(ALL('Table'[Group]), 'Table'[Group] <> "Your Value1" && 'Table'[Group] <> "Your Value2"),
        CALCULATE(
            SUM('Table'[Value])
        ),
        ,
        DESC
    )

 

Also there is a similar thread for this. Check following:

https://community.powerbi.com/t5/Desktop/Rankx-with-filter/td-p/63457

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi, Thanks it works..

 

If you could also help me with Month on Month Rank change DAx.. My rank is changing month on month basis for same group.

 

I want to check the Rank difference of this month to last month  (Trend)

 

Last Month Ranking

MonthUnitDivison Ranking checkAverage of Star Rating
FebGroup1213
FebGroup1122.76
FebGroup1032.62
FebGroup942.57
FebGroup852.36
FebGroup762.33
Feb 72.29
FebGroup582.22
FebGroup492.11
Feb 102.06
FebGroup1112
FebGroup2111.95
FebGroup3121.8
FebTBA13 

 

This month ranking

MonthUnitDivison Ranking checkTrend
MarGroup121312
MarGroup1175
MarGroup1041
MarGroup93-1
MarGroup83-2
MarGroup73-3
Mar 4-3
MarGroup5102
MarGroup42-7
Mar 9-1
MarGroup19-2
MarGroup28-3
MarGroup39-3
MarTBA4-9

 

Tend is representing this month to last month rank difference.. I am new in powerbi so not able to apply the Time intellegence function.. I believe you can answer this question too..

 

Regards

Uphar

Hi @Anonymous ,

 

It will be nice to have a new thread for this as this will require a new DAX. It just helps in keeping the issues differently for everyone.

The query raised in this thread looks like is resolved.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.