Forum Discussion
Chris_68
1 year agoHelper I
Help with bottom N negative results
Hi, I would require help with this troubling issue that I am currently facing. When I am filtering based on bottom N, negative or zero results are appearing. I am tried various method suggeste...
- 1 year ago
Ah, ok, my bad. It's evaluating the rank first, then filtering afterwards.
You'll need to apply the filter prior to each rank evaluation, something like this:
VAR _topItem = RANKX( //Filter table rank is evaluated over FILTER( ALL( Part_Sales[Item] ), [Total Sales] >= 0 ), [Total Sales], , DESC )Check whether this one works as required and, if it does, you'll need to apply a similar filter to each evaluation table in your rank variables.
Pete
BA_Pete
1 year agoSuper User
Ah, ok, my bad. It's evaluating the rank first, then filtering afterwards.
You'll need to apply the filter prior to each rank evaluation, something like this:
VAR _topItem =
RANKX(
//Filter table rank is evaluated over
FILTER( ALL( Part_Sales[Item] ), [Total Sales] >= 0 ),
[Total Sales],
,
DESC
)
Check whether this one works as required and, if it does, you'll need to apply a similar filter to each evaluation table in your rank variables.
Pete
Chris_68
1 year agoHelper I
Hi Pete,
Great work! It is working now.
Thank you.