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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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