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.
Hi all,
I have a dataset looking like the table below with values in column A-C with product numbers and sales per country.
I would like to calculate the percentage of sales per product number in each country (D).
Anyone know the meassure for this?
Product number | Country | Sales | Percentage |
111 | Denmark | 100 | 16,67% |
111 | Norway | 150 | 26,66% |
111 | Sweden | 250 | 40,00% |
111 | Finland | 100 | 16,67% |
222 | Finland | 200 | 25,00% |
222 | Iceland | 200 | 25,00% |
222 | Sweden | 400 | 50,00% |
333 | Denmark | 100 | 20,00% |
333 | Sweden | 400 | 80,00% |
Thank you in advance 🙂
Best regards!
Solved! Go to Solution.
@nbrandborg , Like one of the two
new measure =
divide(Sum(Table[Sales]), calculate(Sum(Table[Sales]), allexcept(Table, Table[Product number])))
new measure =
divide(Sum(Table[Sales]), calculate(Sum(Table[Sales]), filter(allselected(Table), Table[Product number] =maxTable[Product number])))
@amitchandak I have a bonus question. I hope you don't mind!
If I want to pull up the rank the Countries per Product Number in a seperate column, is there a easy way to do this?
If similar procentage value then it should have same ranking like:
Product number | Country | Sales | Percentage | Rank |
111 | Denmark | 100 | 16,67% | 3 |
111 | Norway | 150 | 26,66% | 2 |
111 | Sweden | 250 | 40,00% | 1 |
111 | Finland | 100 | 16,67% | 3 |
222 | Finland | 200 | 25,00% | 2 |
222 | Iceland | 200 | 25,00% | 2 |
222 | Sweden | 400 | 50,00% | 1 |
333 | Denmark | 100 | 20,00% | 2 |
333 | Sweden | 400 | 80,00% | 1 |
@nbrandborg , Like one of the two
new measure =
divide(Sum(Table[Sales]), calculate(Sum(Table[Sales]), allexcept(Table, Table[Product number])))
new measure =
divide(Sum(Table[Sales]), calculate(Sum(Table[Sales]), filter(allselected(Table), Table[Product number] =maxTable[Product number])))
Hi Amit,
Thank you for returning on my question.
The second solution did the job!
Best regards!
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |