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
Anonymous
Not applicable

Power Bi Rank Function Not Staying Constant On Certain Slicers

Hi,

 

Im having an issue with the  rank function. Currently I have a two slicers One on date and the other on Trade counterparty. The rank function works when I change the date but when I change the trade counterparty to narrow it down somehow the rank changes.

Mahirnoor_2-1721653489753.png

This is currently before adding the slicer, and this is the result after the slicer is applied:

Mahirnoor_4-1721653577307.png

Somehow Gold goes from 2nd in the first ranking to 3rd in the second ranking. 

This is my rank function:

CommRank =

CALCULATE (

    RANKX (

        ALL('DEXTR_EQ_Trades'[TRD_COUNTERPARTY]),  // Replace 'Table' and 'Column To Rank' with actual table name and column

        CALCULATE ( SUM ('DEXTR_EQ_Trades'[TRD_COMMISSION_GBP]) )  // Replace 'Table' and 'Value Column' with actual table name and column that has the values to calculate

    )

)

 

Any help would be appreciated.

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous , @rajendraongole1 Thank you for your prompt reply!


Based on my testing, the Rank value will change based on the multislicer context.

 

As a workaround, we can transform the data in Power Query, sort the TRD_COMMISSION_GBP columns in descending order, and then add index columns to make the sorting static:

vyajiewanmsft_0-1721728237206.png

vyajiewanmsft_2-1721728476095.png

 

In this way, we can see the difference between the original rank column and the index column:

vyajiewanmsft_1-1721728392196.png

 

Best regards,

Joyce

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous , @rajendraongole1 Thank you for your prompt reply!


Based on my testing, the Rank value will change based on the multislicer context.

 

As a workaround, we can transform the data in Power Query, sort the TRD_COMMISSION_GBP columns in descending order, and then add index columns to make the sorting static:

vyajiewanmsft_0-1721728237206.png

vyajiewanmsft_2-1721728476095.png

 

In this way, we can see the difference between the original rank column and the index column:

vyajiewanmsft_1-1721728392196.png

 

Best regards,

Joyce

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

rajendraongole1
Super User
Super User

Hi @Anonymous - Can you try the below measure that the rank calculation includes all possible values of TRD_COUNTERPARTY. The ALLSELECTED function ensures that the sum of TRD_COMMISSION_GBP respects the currently selected slicers.

 

CommRank =
CALCULATE (
RANKX (
ALL ( 'DEXTR_EQ_Trades'[TRD_COUNTERPARTY] ),
CALCULATE ( SUM ( 'DEXTR_EQ_Trades'[TRD_COMMISSION_GBP] ) ),
,
DESC
),
ALLSELECTED ( 'DEXTR_EQ_Trades' )
)

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Anonymous
Not applicable

Hi,

 

Im looking for the rank to stay the same and not change how it is calculated.. For example as the "GOLD" is in rank 3 before i select the slicer. When I select the slicer for just GOLD then I want the rank to still be 3, I dont want the rank calculation to be affected.

 

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