Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

RANKX with filter

Hi!

I'm trying to create a DAX measure using RANKX, but I need help. I start with the table to the left where I see all my products and what rank they have based on sales. Then I want to be able to filter on a supplier, for example Supplier = "Supplier1", and then see the product's ranks based on all the products with no Supplier filter applied.

For the left table I get the right output by this measure:

RANKX(
ALL('Table'[Product], 'Table'[Supplier]),
[Sales]
)

 

But I don't get the right output for the right table using the measure...

Any ideas on how to solve this?

 

Thanks in advance!

/Ella

 

 

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

     

    I doubt that [Sales] here is a field without summarize.

    If so, please sum this field.

    then please new:

    Total Sales = SUM('Table'[Sales])
    Rank = RANKX(ALL('Table'[Product],'Table'[Supplier]),[Total Sales])

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

5 Replies