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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors