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
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
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.