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
LOGiT
Regular Visitor

RANKX Not working as expected

Hi,

I have a table which is sorted in desc order by a basic DIVIDE measure in the column called '% Space in Backlog' (see below)

 RANKX Issue.JPG

You can see that many of the '% Space in Backlog' are 100% but it does start to go down after that.

The RANKX I've done is as follows:

Ranktest = RANKX(V_POWERBI_DATASET,[T1CB divided by EstTreatCost])
where the [T1CB divided by EstTreatCost] measure is the '% Space in Backlog' column in the table.
As you can see in the screenshot above, it isn't showing 1 for everything in 100% for the '% Space in Backlog' column. When you go further down, it is even more messy:
RANKX Issue1.JPG
Can someone please help me to get this rank working properly?

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @LOGiT,

You can try to use below measure if it suitable for your requirement:

Ranktest = RANKX(ALLSELECTED(V_POWERBI_DATASET),[T1CB divided by EstTreatCost],,DESC,Dense)

I create a table with some sample data to test.

SalPct = DIVIDE(SUM('Brand Rank'[Sales1]),SUM('Brand Rank'[Sales2]))

CalPct = CALCULATE([SalPct])

RankTest = RANKX(ALLSELECTED('Brand Rank'),[CalPct],,DESC,Dense)

4.png

If above not help. it will be help if you share some sample data and [T1CB divided by EstTreatCost] measure formula for test.

Best Regards,

Jack Chen

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @LOGiT,

You can try to use below measure if it suitable for your requirement:

Ranktest = RANKX(ALLSELECTED(V_POWERBI_DATASET),[T1CB divided by EstTreatCost],,DESC,Dense)

I create a table with some sample data to test.

SalPct = DIVIDE(SUM('Brand Rank'[Sales1]),SUM('Brand Rank'[Sales2]))

CalPct = CALCULATE([SalPct])

RankTest = RANKX(ALLSELECTED('Brand Rank'),[CalPct],,DESC,Dense)

4.png

If above not help. it will be help if you share some sample data and [T1CB divided by EstTreatCost] measure formula for test.

Best Regards,

Jack Chen

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
JosefPrakljacic
Solution Sage
Solution Sage

Hey @LOGiT ,

 

try RANKX(ALL(V_POWERBI_DATASET),CALCULATE([T1CB divided by EstTreatCost]))

 

If this is not working would you mind to share some sample data so that we can try it out by ourselves.

 

If this post was helpful may I ask you to mark it as solution and give it some kudos?

Have a nice day!

BR,
Josef

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.