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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Rankx showing incorrect result based on slicer selection

HI Team,

 

Greetings!

 

Currently working on a Tableau to Power BI migration .

The Power BI report is built on Single Fact Table connected with date dimension table for time intelligence functions 

  • I am using Rankx function(Measure) to rank the "corporation" based on "sales/Unit" value, in two places 
    1. Overall rank (all region) - KPI
    2. Each region wise rank  - In a table
    3. using this formula . Rank = rankx(all('Table'[Corporation]),[sales/unit],[sales/unit])
  • "Sales/Unit" is a parameter , it is achieved by disconnected table .Created slicer using this. So if we select "Sales" it will give "Sales" value and "Units" it will give "Units"
  • "Sales/Unit" will change based on time intelligence functions "YTD/MAT/QTR"
  • The power BI file size is above 1 GB.(Used import mode )

 

Issue: When Open the report with the default selection lets say - sales,YTD giving the correct rank but if we change the parameter to units , MAT - showing incorrect rank. so saved with this selection.

 

When I try to open again - now the selection is units , MAT - it is showing the correct Rank . If we change it to some other parameter like Sales,QTR then incorrect rank showing.

 

I am not sure this is some kind of bug or due to large data set size it is throwing incorrect result or something.

 

Please let me know if we have a solution for these issue.

 

Note: Other than rank , every other kpi is showing correct result , only having issues with rankx function

 

*Tried to check by creating rankx calculated column it was working fine but I cannot use dynamic measure sales/units. (which is the requirement)

*Tried to check by using sample data - it is working fine there as well. it is not working in actual dataset.

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@Anonymous Hard to say, maybe this will help: https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452

 

Otherwise, Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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