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 am trying to use the RANKX function to show my top 300 items by sales value. I also need to show this broken out by store and product division.
The catch is, I need it to adjust it's ranking so each store location has a top 300 items by sales value, but the product division does not change the rankings. So each Location would have 300 top selling skus, that I could see the number of by Division, but that division doesn't affect the rankings
My rankx formula is:
Top 300 SkusB = rankx(allselected('2016844 Ontario Ltd$Replen_ Item Quantity'[Item No_]),calculate(sum('2016844 Ontario Ltd$Value Entry$VSIFT$4'[Sales Amount (Actual)])))
Is there a way to have the division code excluded from the rankings when I put it in the ideal layout as shown below?
@sarafenwick Any dummy data and desired results shared is appreciated.
See below for sample data. The desired result would rank as follows below... it would rank each location separately but not each division. So ideally I could show the out of stocks by location for the top 300 grossing skus, but be able to show which divisions those skus come from without showing the top 300 grossing skus by location by division.
Item No_ | Total Sales Value | Not in Stock | Total Skus | Location Code | Item Division Code |
100012 | 2530.97 | 1 | 1 | S14-MAIN | GR |
100013 | 5130.66 | 1 | S03-MAIN | GR | |
100013 | 5130.66 | 1 | S04-MAIN | GR | |
100013 | 5130.66 | 1 | S05-MAIN | GR | |
100013 | 5130.66 | 1 | S06-MAIN | GR | |
100013 | 5130.66 | 1 | S07-MAIN | GR | |
100013 | 5130.66 | 1 | S08-MAIN | GR | |
100013 | 5130.66 | 1 | S09-MAIN | GR | |
100013 | 5130.66 | 1 | S10-MAIN | GR | |
100013 | 5130.66 | 1 | S11-MAIN | GR | |
100013 | 5130.66 | 1 | S12-MAIN | GR | |
100013 | 5130.66 | 1 | S13-MAIN | GR | |
100014 | 5433.83 | 1 | DC-MAIN | GR | |
100014 | 5433.83 | 1 | S02-MAIN | GR | |
100014 | 5433.83 | 1 | S03-MAIN | GR | |
100014 | 5433.83 | 1 | S04-MAIN | GR | |
100014 | 5433.83 | 1 | S05-MAIN | GR | |
100014 | 5433.83 | 1 | S06-MAIN | GR | |
100014 | 5433.83 | 1 | S07-MAIN | GR | |
100014 | 5433.83 | 1 | S08-MAIN | GR | |
100014 | 5433.83 | 1 | S09-MAIN | GR | |
100014 | 5433.83 | 1 | S10-MAIN | GR | |
100014 | 5433.83 | 1 | S11-MAIN | GR | |
100014 | 5433.83 | 1 | S12-MAIN | GR | |
100014 | 5433.83 | 1 | S13-MAIN | GR | |
100033 | 15487.29 | 1 | 1 | S14-MAIN | DG |
100033 | 15487.29 | 1 | DC-MAIN | DG | |
100051 | 22407.19 | 1 | 1 | S13-MAIN | DG |
100051 | 22407.19 | 1 | S02-MAIN | DG | |
100051 | 22407.19 | 1 | S03-MAIN | DG | |
100051 | 22407.19 | 1 | S04-MAIN | DG | |
100051 | 22407.19 | 1 | S05-MAIN | DG | |
100051 | 22407.19 | 1 | S06-MAIN | DG | |
100051 | 22407.19 | 1 | S07-MAIN | DG | |
100051 | 22407.19 | 1 | S08-MAIN | DG | |
100051 | 22407.19 | 1 | S09-MAIN | DG | |
100051 | 22407.19 | 1 | S10-MAIN | DG | |
100051 | 22407.19 | 1 | S11-MAIN | DG | |
100051 | 22407.19 | 1 | S12-MAIN | DG |
Desired Result Ranking:
Item No_ | Total Sales Value | Not in Stock | Total Skus | Location Code | Item Division Code | Desired Rank Outcome |
100033 | 15487.29 | 1 | DC-MAIN | DG | 1 | |
100014 | 5433.83 | 1 | DC-MAIN | GR | 2 | |
100051 | 22407.19 | 1 | S02-MAIN | DG | 1 | |
100014 | 5433.83 | 1 | S02-MAIN | GR | 2 | |
100051 | 22407.19 | 1 | S03-MAIN | DG | 1 | |
100014 | 5433.83 | 1 | S03-MAIN | GR | 2 | |
100013 | 5130.66 | 1 | S03-MAIN | GR | 3 | |
100051 | 22407.19 | 1 | S04-MAIN | DG | 1 | |
100014 | 5433.83 | 1 | S04-MAIN | GR | 2 | |
100013 | 5130.66 | 1 | S04-MAIN | GR | 3 | |
100051 | 22407.19 | 1 | S05-MAIN | DG | 1 | |
100014 | 5433.83 | 1 | S05-MAIN | GR | 2 | |
100013 | 5130.66 | 1 | S05-MAIN | GR | 3 | |
100051 | 22407.19 | 1 | S06-MAIN | DG | 1 | |
100014 | 5433.83 | 1 | S06-MAIN | GR | 2 | |
100013 | 5130.66 | 1 | S06-MAIN | GR | 3 | |
100051 | 22407.19 | 1 | S07-MAIN | DG | 1 | |
100014 | 5433.83 | 1 | S07-MAIN | GR | 2 | |
100013 | 5130.66 | 1 | S07-MAIN | GR | 3 | |
100051 | 22407.19 | 1 | S08-MAIN | DG | 1 | |
100014 | 5433.83 | 1 | S08-MAIN | GR | 2 | |
100013 | 5130.66 | 1 | S08-MAIN | GR | 3 | |
100051 | 22407.19 | 1 | S09-MAIN | DG | 1 | |
100014 | 5433.83 | 1 | S09-MAIN | GR | 2 | |
100013 | 5130.66 | 1 | S09-MAIN | GR | 3 | |
100051 | 22407.19 | 1 | S10-MAIN | DG | 1 | |
100014 | 5433.83 | 1 | S10-MAIN | GR | 2 | |
100013 | 5130.66 | 1 | S10-MAIN | GR | 3 | |
100051 | 22407.19 | 1 | S11-MAIN | DG | 1 | |
100014 | 5433.83 | 1 | S11-MAIN | GR | 2 | |
100013 | 5130.66 | 1 | S11-MAIN | GR | 3 | |
100051 | 22407.19 | 1 | S12-MAIN | DG | 1 | |
100014 | 5433.83 | 1 | S12-MAIN | GR | 2 | |
100013 | 5130.66 | 1 | S12-MAIN | GR | 3 | |
100051 | 22407.19 | 1 | 1 | S13-MAIN | DG | 1 |
100014 | 5433.83 | 1 | S13-MAIN | GR | 2 | |
100013 | 5130.66 | 1 | S13-MAIN | GR | 3 | |
100033 | 15487.29 | 1 | 1 | S14-MAIN | DG | 1 |
100012 | 2530.97 | 1 | 1 | S14-MAIN | GR | 2 |
Try with this:
Ranking = CALCULATE(RANKX(ALLSELECTED(Table1[Item No_]);CALCULATE(SUM(Table1[Total Sales Value])));ALLEXCEPT(Table1;Table1[Item No_];Table1[Location Code]))
This is very close. I can now get it in a table like below and it does rank properly... the issue is when i try to summarize the data by division and location in a matrix.
I want to filter the rank to top 300. Which is fine for the table, but in the matrix it is showing all values and not taking the 300 filter into account. Any thoughts? As you can see in the table the total skus are 300 which is right, the matrix has 6768 but should total to only 300.
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 |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |