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
brentmav
Frequent Visitor

Issues with RANKX measure when adding additional dimension column

My rank measure works well when only introducing the ranked items, but when I introduce a category for each item (in this example, it's a geographic region) the rank measure returns false ties and skips unused rank numbers.  See screenshot below, where the table on the left omits the geograhic location, and the table on the right includes it.

 

rankx.png

 

 

 

 

 

 

Generically, the rank and ranked measure look like this:

 

% RANK = 

RANKX (
    ALLSELECTED ( 'Dimension'[Item] ),
    CALCULATE ( [% Measure], ALLEXCEPT ( 'Dimension', 'Dimension'[Item] ) )
)

 

% Measure = 

DIVIDE (

SUM ( 'FACT_1'[COLUMN_1] ),
SUM ( 'FACT_2'[COLUMN_2] ),
BLANK()

)

 

Am I missing something to control for the additional category added to the visual?  My understanding is that this should only come into play if I wanted to rank within each category, but this rank measure is independent of the category.

 

NOTE: I'm trying to replicate within a dummy dataset to share but have not been successful yet.  

1 ACCEPTED SOLUTION
brentmav
Frequent Visitor

Resolved this with the updated measure:

 

% RANK = 

RANKX (
    ALL ( 'Dimension' ),
    CALCULATE ( [% Measure], ALLEXCEPT ( 'Dimension', 'Dimension'[Item], 'Dimension'[Category]) )
)

View solution in original post

1 REPLY 1
brentmav
Frequent Visitor

Resolved this with the updated measure:

 

% RANK = 

RANKX (
    ALL ( 'Dimension' ),
    CALCULATE ( [% Measure], ALLEXCEPT ( 'Dimension', 'Dimension'[Item], 'Dimension'[Category]) )
)

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.