Forum Discussion
Help with bottom N negative results
- 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
Hi Pete,
You're right—it may be working, but it looks like entries with a value of 0 aren't showing in the table. For example, when I select Top 10, nothing appears. But with Top 20, only 8 customers show up.
Would appreciate any suggestions you have.
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_681 year agoHelper I
Hi Pete,
Great work! It is working now.
Thank you.