The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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?
Solved! Go to Solution.
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?
Try
Year Rank= RANKX(all('Table'[year Of sales]),[Total Spend By Year],,DESC,Dense)
Also refer : https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
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?
User | Count |
---|---|
74 | |
70 | |
39 | |
30 | |
28 |
User | Count |
---|---|
104 | |
95 | |
51 | |
48 | |
46 |