Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How to use RankX and Summarize

We need to return a table where we can look at all products for 2018 and 2019 and to be able to filter on the ranking of the customer's total spend in 2018 on all products (ranked against spend for other customers in 2018).  How would we use Rankx and Summarize to do this.  Any other suggestions?

 
  • If I understand your requirements correctly I think the following will work. It calculates the ranking for a product across all customers based on the 2018 sales.

     

    Measure = RANKX(CALCULATETABLE('Table', ALL('Table'[Customer]), 'Table'[YearOfSale] = 2018), calculate(SUM('Table'[Total Spend by Year])))

     

    If this is not what you are after can you post your expected results based on the dataset above?

2 Replies