Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have gone through the forum and have found many queries which pertain to the above topic (have searched on TopN and RankX). I have tried all of them and have not been able to come up with the correct result.
I will try and put my problem in as simple terms as I can. So here goes.
I am trying to create some analytics for a restaurant. I want to show the Top 10 items which were sold (by quantity) withing a given date range (dates being select from a slicer - picking years or months)
So I created a measure for summing up my quantities
Msr_SaleQty = sum('sales'[quantity])
Next I created another measure to get the Rank
Msr_Rank_by_qty = RANKX(ALL('sales'[item]),[msr_saleqty])
So far so good.
Now I create a table visualization and add the item, quantity and the Rank in it. ( i have just done Top 3 in the example)
This works perfectly.
However If I add a month column into this table, I get the ranking for each month. So If I have selected 2 months, then I will get 6 rows.
But I just want the composite ranking within whatever periods I have selected.
I have looked at the following article
Tried to change my ranking measure according to this
Created another measure as follows
Msr_Rank_by_qty1 = RANKX(ALLSELECTED('sales'),CALCULATE(sum('sales'[quantity])))
Now the results are worse..
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |