Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Dear all,
I want to do dynamic ranking within a matrix. I can easily achieve ranking within region (green column), and my question is, how to achieve the ranking across regions (yellow column)? It doesnt seem like the evaluation can break the upper region context.
Ranking =
var territoryRanking = rankx(allselected(salesHier[Territories]), [TotalSales])
var RegionRanking = rankx(allselected(salesHier[Regions]), [TotalSales])
return if(isinscope(salesHier[Territories]), territoryRanking, if(isinscope(salesHier[Regions]), RegionRanking, blank()))
Thank you so much!
NM
Solved! Go to Solution.
Your ideas is great @lbendlin
Hi, @NM2023
I created a matrix using the following sample data:
I created a measure using the following DAX expression:
Measure =
IF(ISINSCOPE('Table'[territories]),RANKX(ALLSELECTED('Table'),'Table'[Measure 2]))
I've provided the PBIX file used this time below.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Your ideas is great @lbendlin
Hi, @NM2023
I created a matrix using the following sample data:
I created a measure using the following DAX expression:
Measure =
IF(ISINSCOPE('Table'[territories]),RANKX(ALLSELECTED('Table'),'Table'[Measure 2]))
I've provided the PBIX file used this time below.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Use REMOVEFILTERS() on the Regions and Territories.
NM,
Can you please share a sample pbix file? (If you don't know how, please check the pinned thread in the forum.) It would make debugging your issue easier. 🙂
Proud to be a Super User! | |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
76 | |
60 | |
36 | |
33 |
User | Count |
---|---|
91 | |
60 | |
59 | |
49 | |
45 |