Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
marcoproserpio
Helper II
Helper II

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?

marcoproserpio_0-1624519134338.png

marcoproserpio_1-1624519150618.png

 

Thank you.

1 ACCEPTED SOLUTION
marcoproserpio
Helper II
Helper II

Thank you for your answer, 
I found out a different solution.

 

ranking = if([%Scrap]<>1, RANKX(all(Data), [%Scrap]), blank() )
 

marcoproserpio_0-1624625421904.png

 

View solution in original post

2 REPLIES 2
marcoproserpio
Helper II
Helper II

Thank you for your answer, 
I found out a different solution.

 

ranking = if([%Scrap]<>1, RANKX(all(Data), [%Scrap]), blank() )
 

marcoproserpio_0-1624625421904.png

 

Anonymous
Not 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:

https://docs.microsoft.com/en-us/dax/topn-function-dax

https://www.youtube.com/watch?v=ljAINOUt-X8 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.