Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have a matrix in Power BI and
measures for Revenue Year 1; Revenues Year 2; RankX
parameters for Revenue Year 1; Revenue Year 2 ; TopN- for the users to choose the top count where I have a Rankif function
in the filter pane
Customer | 2024 | 2025 | Dynamic Rank Compare 2024 -> 2025 or 2025->2024 |
A | 90 | 50 | 1 |
B | 50 | 60 | 2 |
C | 40 | 40 | 3 |
D | 10 | 20 | 4 |
E | 6 | 70 | 5 |
Everything is working except the RankIf in filterpane so that user cannot enter manually how many top rows to display. I don't know where exactly I am going wrong. I tried to replicate the same in the attcahed below
Solved! Go to Solution.
Hi @ribs ,
You can try this DAX
This makes Rankx return blank at the Customer No. level, so it doesn’t affect or show on subcategories.
Attached file for reference.
Hope this helps!
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You!
Hi @ribs ,
Good to know you were able to arrive at the solution.
If the response has addressed your query, please accept it as a solution so other members can easily find it.
Thank You!
Hi @ribs ,
Good to know you were able to arrive at the solution.
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You!
@v-sdhruv Thank you so much! This solution is close enough to my requirement. I'll try to find a workaround as the RankX disappears when I drilldrown the visual to view one or all the customer number.
Hi @ribs ,
You can try this DAX
This makes Rankx return blank at the Customer No. level, so it doesn’t affect or show on subcategories.
Attached file for reference.
Hope this helps!
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You!
@bhanu_gautam I have tried this already it is not working.In the matrix rows pane I have two columns- Customer and Customer No like the image below. Because of the subategory Customer No, the RankIf is not working. Is it possible to not to apply ranking to the subcategory? Or if at all applied, not to cosnider in RankIf()?
@ribs Try using
RankX Measure: RankX = RANKX(ALL('Customer'), [Revenue Year 1], , DESC, DENSE)
RankIf Measure: RankIf = IF([RankX] <= SELECTEDVALUE('TopN'[TopN Value]), 1, 0)
TopN Parameter Table: TopN = GENERATESERIES(1, 10, 1)
Go to the matrix visual.
Drag the RankIf measure to the Visual Level Filters pane.
Set the filter to show only rows where RankIf equals 1.
Proud to be a Super User! |
|
User | Count |
---|---|
17 | |
16 | |
14 | |
13 | |
13 |
User | Count |
---|---|
14 | |
12 | |
11 | |
8 | |
7 |