Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I am attempting to create a ranking table whereby a user uses drop down boxes for select items, this then filters down a table and subsequently measures calculate rankings based on this filtered down data.
I have tried numerous approaches including:
https://community.powerbi.com/t5/Desktop/RANKX-with-groups/m-p/306074
https://www.youtube.com/watch?v=pW76t-pdUPE
and some combination thereof and have not been able to come up with a solution.
The rankings must be calculated by a measure as it is not possible to use calculated columns (I believe) due to the dynamic nature of the filtered down table.
Further, it should be noted that the table I am doing this for is already aggregated with a measure used for the ranking value.
The below image depicts the situation, the first portion shows the layout with ALL data included. The overall rank is the 'Max Speed Achieved' column order from highest to smallest, whereas the Rank By Car Type is the max speed achieved by each of the Cars. Further you will see that we have 3 select boxs that can be used to filter down the table.
In the second portion of the image, the data is dynamically filtered for just John and Luke, the overall rank and rank by car type, both update to reflect ONLY the data that is included in the table (based on the filters).
How should each of the ranking measures be calculated?
Any help is greatly appreciated!
Solved! Go to Solution.
The two that worked for me, using your answer as a starting point, are:
overall Rank = rankx(summarize(allselected(Table), Table[Name], Table[Car Type], [Color]), [MAx speed achieved], , desc,dense)
@JFG123 , Try like
Assume you have measure [MAx speed achieved]
overall Rank = rankx(allselected(Table), [MAx speed achieved], , desc,dense)
or
overall Rank = rankx(summarize(allselected(Table), Table[Name], Table[Car Type], [Color]), [MAx speed achieved], , desc,dense)
Rank by Car Type =
calculate([MAx speed achieved], filter(summarize(allselected(Table), Table[Name], Table[Car Type]]), [Car Type] = max(Car Type])), MAx speed achieved])
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
The two that worked for me, using your answer as a starting point, are:
overall Rank = rankx(summarize(allselected(Table), Table[Name], Table[Car Type], [Color]), [MAx speed achieved], , desc,dense)
User | Count |
---|---|
125 | |
108 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |