Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi, I want to create a rank measure with dynamic and should consider the slicer, but I have no idea how to solve it, here is my data and expected result, hope to get some ideas to solve it.
data:
I dragged the category and sub category in rows, and "value" to values,
expected result with rank of total in matrix, the blue background is total row in matrix, the rank should be order by descending
Solved! Go to Solution.
HI @Anonymous
Please try the following:
data
Measure:
RANK | 2 dim rank =
IF(
ISINSCOPE(SampleDynamicRank[sub_category]),
RANKX(
ALLEXCEPT(SampleDynamicRank,SampleDynamicRank[Category])
,CALCULATE(SUM(SampleDynamicRank[value]))
)
,
RANKX(
ALL(SampleDynamicRank[category])
,CALCULATE(SUM(SampleDynamicRank[value]))
)
)
@Anonymous I updated the formula by replacing HASONEVALUE with ISINSCOPE. THe version before had a bug when there was only one sub category under a category. Using ISINSCOPE it works fine
Result
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
HI @Anonymous
Please try the following:
data
Measure:
RANK | 2 dim rank =
IF(
ISINSCOPE(SampleDynamicRank[sub_category]),
RANKX(
ALLEXCEPT(SampleDynamicRank,SampleDynamicRank[Category])
,CALCULATE(SUM(SampleDynamicRank[value]))
)
,
RANKX(
ALL(SampleDynamicRank[category])
,CALCULATE(SUM(SampleDynamicRank[value]))
)
)
@Anonymous I updated the formula by replacing HASONEVALUE with ISINSCOPE. THe version before had a bug when there was only one sub category under a category. Using ISINSCOPE it works fine
Result
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
103 | |
98 | |
98 | |
38 | |
37 |
User | Count |
---|---|
152 | |
120 | |
73 | |
72 | |
63 |