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.
I have Customer, Country, Product, and Sales Value.. I want to use Rankx on customer but when i drilled it down further on country level... it will show rank of customer within in country(single) and same for Product like rank of Customers in one country for single producte... I want to use matrix here (and also can we use group by to get top 5 customers and rest in others ).. Experts pls help
Solved! Go to Solution.
It took me a bit, but I was able to find this blog post that explained exactly how to do it. I've updated their expression to use ISINSCOPE, which works better for matrices.
Rank = IF( ISINSCOPE(Sales_Data[Product]), RANKX(ALL(Sales_Data[Product]), CALCULATE(SUM(Sales_Data[Sales]))), IF( ISINSCOPE(Sales_Data[Country]), RANKX(ALL(Sales_Data[Country]), CALCULATE(SUM(Sales_Data[Sales]))), IF(ISINSCOPE(Sales_Data[Customer]), RANKX(ALL(Sales_Data[Customer]), CALCULATE(SUM(Sales_Data[Sales])))) ) )
This will return the rank for whatever scope you're currently in. Using this, I was able to create this visual, where the rank responds to the current level of drilldown, and will still rank against values that are filtered out of the visual:
Hi
We can barely replicate your issue, plz kindly share more details, thanks.
Dear all,
am using below DAX, did some R&D also but unable to get the desired reult.
It took me a bit, but I was able to find this blog post that explained exactly how to do it. I've updated their expression to use ISINSCOPE, which works better for matrices.
Rank = IF( ISINSCOPE(Sales_Data[Product]), RANKX(ALL(Sales_Data[Product]), CALCULATE(SUM(Sales_Data[Sales]))), IF( ISINSCOPE(Sales_Data[Country]), RANKX(ALL(Sales_Data[Country]), CALCULATE(SUM(Sales_Data[Sales]))), IF(ISINSCOPE(Sales_Data[Customer]), RANKX(ALL(Sales_Data[Customer]), CALCULATE(SUM(Sales_Data[Sales])))) ) )
This will return the rank for whatever scope you're currently in. Using this, I was able to create this visual, where the rank responds to the current level of drilldown, and will still rank against values that are filtered out of the visual:
Can you share the DAX expression you're using RANKX in? You likely just need to add in an ALL statement to your syntax, but without knowing what it looks like, I can't help much.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |