Forum Discussion
Dynamic Top N Ranking with Bucket-Based Filter Context
- 3 months ago
Hi Julia2023 ,
I was able to reproduce the scenario successfully using a sample dataset, and the ranking/filtering worked correctly with the shared approach.
I have attached a sample PBIX file for reference so you can compare the implementation with your current model/setup.
If the issue still exists, please share the following details -
sample data/model structure
expected output
current output screenshotso the exact filter context behavior can be reproduced and checked further.
Thank you.
Hi Julia2023 ,
I was able to reproduce the scenario successfully using a sample dataset, and the ranking/filtering worked correctly with the shared approach.
I have attached a sample PBIX file for reference so you can compare the implementation with your current model/setup.
If the issue still exists, please share the following details -
sample data/model structure
expected output
current output screenshot
so the exact filter context behavior can be reproduced and checked further.
Thank you.
Thank you! It worked. The only issue I’m facing now is that in Power BI, the Rank (Top X) measure shows different values when used as a table field versus when used as a filter. The values shown in the table are correct.
Is there a workaround to create a measure for the slicer so that it returns the same values as in the table when used as a filter as well?
Rank (Top X) = VAR _top = SELECTEDVALUE('Slicer'[Parameter]) RETURN IF( RANKX( ALLSELECTED(Product[Product]), [Actual Sales $], , DESC, DENSE ) <= _top, 1, 0 )