Forum Discussion

Chris_68's avatar
Chris_68
Helper I
1 year ago
Solved

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...
  • BA_Pete's avatar
    BA_Pete
    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