Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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!
Solved! Go to Solution.
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
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
Hello,
Has anyone any solution on my problem? Any ideas are much appreciated!
Thanks!
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
19 | |
14 | |
8 | |
7 |