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
AdiAsavaid
Frequent Visitor

RANKX Function at higher levels in hierarchy

RankX issue at Parent LevelRankX issue at Parent LevelHello All:

Hoping somebody can help me to see what I am doing incorrectly.

This is regarding RANK function. I have a simple table of 3 columns called Dim_Plan with PlanName, #LivesPerPlan, AccountName. AccountName is parent of PlanName.

The Ranking formula is generic and is not referencig any specific Column. It works correctly at the lowest level (PlanName) but the RankX function does not work at higher level which is AccountName.

What am I doing incorrectly here?

Thanking you in advance for your help.

Best regards....Adi

 

2 ACCEPTED SOLUTIONS
v-chuncz-msft
Community Support
Community Support

@AdiAsavaid,

 

You may use ALLSELECTED ( Dim_Plan[AccountName] ) instead.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hello Sam:

Following up on my previous message and your suggestion:

Yes, the suggested formula does work but I have to create a new measure now. Specifically:

#RankAcct = RANKX(AllSELECTED(Dim_Plan[AccountName]), [#LivesPlan]) - works but it is a new measure

#Ranking = RANKX(AllSELECTED(Dim_Plan[AccountName]), [#LivesPlan]) - works on the lowest level for Dim_Plan table.

I have 6 different other attributes like AccountName in the Dim_Plan, and guess I would have to create new Measures for each.

I was hoping a single measure could be used instead of so many different measures.

For the moment I can live with the different measures.

Thanks for the solve.

Best regards....Adi

 

View solution in original post

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@AdiAsavaid,

 

You may use ALLSELECTED ( Dim_Plan[AccountName] ) instead.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello Sam:

Many thanks for your response.

However, my measure '#Ranking' does use AllSELECTED and is as follows:

#Ranking = RANKX(AllSELECTED(Dim_Plan), [#LivesPlan]) and

#LivePlan = CALCULATE(SUM(Dim_Plan[#LivesPlanC]))

 

Do you have any other suggestion to make this work ?

Thanks and best regards....Adi

Hello Sam:

Following up on my previous message and your suggestion:

Yes, the suggested formula does work but I have to create a new measure now. Specifically:

#RankAcct = RANKX(AllSELECTED(Dim_Plan[AccountName]), [#LivesPlan]) - works but it is a new measure

#Ranking = RANKX(AllSELECTED(Dim_Plan[AccountName]), [#LivesPlan]) - works on the lowest level for Dim_Plan table.

I have 6 different other attributes like AccountName in the Dim_Plan, and guess I would have to create new Measures for each.

I was hoping a single measure could be used instead of so many different measures.

For the moment I can live with the different measures.

Thanks for the solve.

Best regards....Adi

 

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