Forum Discussion
Filter Top N object with condition
Goodmorning,
I'm showing the top 5 values of a ratio for a given date, i.e.
Scrap% = Scrap/ (Good+Scrap).
The idea is that I don't want to show values of scrap of 100% (Good=0), therefore I applied a filter on the values different from 100%.
The problem is that my top 5 values table is blank, as I imagine that power bi identifies those 100% values as top n but then doesn't plot it as they has to be different from 100%. How can I deal with that?
Thank you.
- Anonymous5 years ago
Thank you for your answer,
I found out a different solution.ranking = if([%Scrap]<>1, RANKX(all(Data), [%Scrap]), blank() )
2 Replies
- AnonymousNot applicable
You'll need to create a measure with TOPN instead of the slicer so you can be abble to modify the filter context. Just note that to use TOPN in a measure you'll need to have summarization/aggregation expressions in it. They are a little bit complex, but you can get there with a couple of tutorials.
Here are some references that might help you:
- AnonymousNot applicable
Thank you for your answer,
I found out a different solution.ranking = if([%Scrap]<>1, RANKX(all(Data), [%Scrap]), blank() )