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

Ignore slicer of ranking column based on hierarchical data

Hi all,

I have created a matrix where I have multiple Values, including a ranking measure based on one of these values. I use 3 field names as my Rows, coming from a table with hierarchical data (Org -> Region -> Country ). My DAX expression for the Ranking measure is the following:

Rank = 
var _RankOrg = RANKX(ALLSELECTED('table'),[Rank Value],,DESC,Dense)
var _RankRegion = RANKX(ALLSELECTED('table'[Region],'table'[Org]),[Measure 1],,DESC,Dense)
var _RankCountry = RANKX(ALLSELECTED('table'[Country],'table'[Region],'table'[Org]),[Measure 1],,DESC,Dense)

RETURN
SWITCH (
    TRUE (),
    isinscope('table'[Country]) , _RankCountry,
    isinscope('table'[Region]) , _RankRegion,
    isinscope('table'[Org]) , _RankOrg,
    blank()
)

where [Measure 1] = is the measure based on that I want to define the ranking
and where [Rank Value] = 

CALCULATE( DIVIDE('Measures'[My Value],'Measures'[Total Market Value]),
ALLEXCEPT('table',table[Org]))

 

The ranking calculation works smoothly so far and as I drilldown in my matrix, I get the ranking figures per level (Org/Region/Country) properly.

My problem is that I want this ranking calculation to ignore the respective slicer I have (Org/Region/Country). So, when a user selects any of these values, the ranking figures should stay the fixed and they should not getting impacted by the selections of this slicer.

 

Any thoughts/ideas on this? Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please update the formula of measure [Rank] as below and check if it can get the expected result...

Rank =
VAR _RankOrg =
    RANKX ( ALL ( 'table' ), [Rank Value],, DESC, DENSE )
VAR _RankRegion =
    RANKX ( ALL ( 'table'[Region], 'table'[Org] ), [Measure 1],, DESC, DENSE )
VAR _RankCountry =
    RANKX (
        ALL ( 'table'[Country], 'table'[Region], 'table'[Org] ),
        [Measure 1],
        ,
        DESC,
        DENSE
    )
RETURN
    SWITCH (
        TRUE (),
        ISINSCOPE ( 'table'[Country] ), _RankCountry,
        ISINSCOPE ( 'table'[Region] ), _RankRegion,
        ISINSCOPE ( 'table'[Org] ), _RankOrg,
        BLANK ()
    )

In addition, you can refer the following blog to try to solve the problem.

RANKX-apalooza: Within and Across Groups, With Filters, Etc. - P3 Adaptive

 

If the above ones can't help you figure out, please provide some source data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

Please update the formula of measure [Rank] as below and check if it can get the expected result...

Rank =
VAR _RankOrg =
    RANKX ( ALL ( 'table' ), [Rank Value],, DESC, DENSE )
VAR _RankRegion =
    RANKX ( ALL ( 'table'[Region], 'table'[Org] ), [Measure 1],, DESC, DENSE )
VAR _RankCountry =
    RANKX (
        ALL ( 'table'[Country], 'table'[Region], 'table'[Org] ),
        [Measure 1],
        ,
        DESC,
        DENSE
    )
RETURN
    SWITCH (
        TRUE (),
        ISINSCOPE ( 'table'[Country] ), _RankCountry,
        ISINSCOPE ( 'table'[Region] ), _RankRegion,
        ISINSCOPE ( 'table'[Org] ), _RankOrg,
        BLANK ()
    )

In addition, you can refer the following blog to try to solve the problem.

RANKX-apalooza: Within and Across Groups, With Filters, Etc. - P3 Adaptive

 

If the above ones can't help you figure out, please provide some source data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Anonymous
Not applicable

Hello, 

 

Has anyone any solution on my problem? Any ideas are much appreciated!

 

Thanks!

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.