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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
jeffgarlisch
Helper I
Helper I

RANKX showing duplicated ranks for different values

Hey All, 

 

 

Ive used both these RANKX functions to calculate the ranking based on a measure and it is returning duplicate values for certain rows, as well as skipping numbers. As you can see  in the screenshot below the numbers are not the same so i'm not sure what is happening here. 

 

I've looked at all the other isntances of this happening and have not been able to find a solution that worked for me.

 

Any advice is apprecaited!

 

Ranking = RANKX(ALL(QUALNUMJULY[CAI],QUALNUMJULY[Qualification]),[% Diff All],,0,DENSE)


Ranking = RANKX(ALL(QUALNUMJULY[CAI],QUALNUMJULY[Qualification]),[% Diff All],,0)

Ranking = RANKX(QualNumJuly,[% Diff All],,0)

Capture.JPG

 

 

I am calculating the % Diff column using these three DAX formulas

 

 

Calculates % of Column Total for all Categories

%OfAllTotal = Divide([Total Qual],CALCULATE([Total Qual],ALL(QUALNUMJULY[Qualification],QUALNUMJULY[CAI],QUALNUMJULY[DBAName],QUALNUMJULY[AccountNumber])))
Calculates total records

Total Qual = COUNT(QUALNUMJULY[Qualification])

 

Calculates the % Difference between Column Totals Based on available data sources

% Diff All = CALCULATE(QUALNUMJULY[%OfAllTotal],QUALNUMJULY[SourceIdentification] = "<A>") - CALCULATE(CALCULATE(QUALNUMJULY[%OfAllTotal],QUALNUMJULY[SourceIdentification] = "<Y>"))

 

 

The % Difference should always be calculated as DataSource A - DataSource Y.

 

At the moment there are only two data sources, in the future there will be many more, DataSource C, D, E....

 

Datasource Y will be a constant value, and Datasource A will change per Datasource.

2 REPLIES 2
Seward12533
Solution Sage
Solution Sage

I'm still learning RANKX but I thinkg your ALL is causing values filtered out of your report that the calcualtion is considering. 

Still having the same issue without the ALL. 

 

 

Here Are the DAX Formulas running my measure.

 

 

Calculates Total Records

 

 

Total Qual = COUNT(QUALNUMJULY[Qualification])

 

 

Calculates % Column Total per Categories

 

 

%OfAllTotal = Divide([Total Qual],CALCULATE([Total Qual],ALL(QUALNUMJULY[Qualification],QUALNUMJULY[CAI],QUALNUMJULY[DBAName],QUALNUMJULY[AccountNumber])))


Calculates Percent Difference Between % Column Total Per Data Source

 

% Diff All = (CALCULATE(QUALNUMJULY[%OfAllTotal],QUALNUMJULY[SourceIdentification] = "<Pivotal Payments>")) - (CALCULATE(QUALNUMJULY[%OfAllTotal],QUALNUMJULY[SourceIdentification] = "<CT Payments>"))

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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