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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors