March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
HI Team,
Can anyone please help me with the below Rank calculation.
This is my P. Dimension Breakdown looks like
Hi Sahir,
as per your suggestion i created those calculations for each dimensions and tried to pass it all together but its throwing the below error. It looks like the p.Dimension breakdown parameter is not appearing when i try to use in the calculation
This will return the correct rank based on the selected dimension in the parameter.
Let me know if you require any further assistance.
Similarly, you can create measures for the Region and Category dimensions. Then, you can use a calculated column to switch between these measures based on the selected dimension in the parameter. For example:
Rank =
SWITCH(
p.Dimension,
"Country", [Rank by Country],
"Name", [Rank by Name],
"Region", [Rank by Region],
"Category", [Rank by Category],
BLANK()
)
For the Name dimension, you can create another measure:
Rank by Name = RANKX(ALL(RESULTS[Name]), CALCULATE(SUM(RESULTS[CADRE POINTS])))
To resolve this, you can create a separate measure for each dimension that you want to use for ranking and then switch between these measures based on the selected dimension in the parameter. For example, for the Country dimension, you can create the following measure:
Rank by Country = RANKX(ALL(RESULTS[Country]), CALCULATE(SUM(RESULTS[CADRE POINTS])))
Hi Sahir,
Thank you for the response, so, instead of All what can i use?
Hello @Madhusmita,
The issue is happening because the RANKX function expects a table expression as the first argument. When you use ALL(RESULTS[Country]), you are passing a table expression that includes only the Country column. However, when you use ALL(p.Dimension[p.Dimension]), you are passing a table expression that includes multiple columns (Country, Name, Region, and Category).
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
146 | |
97 | |
79 | |
69 |