Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
nbrandborg
Helper II
Helper II

Percentage of total per product number

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 numberCountrySalesPercentage
111Denmark10016,67%
111Norway15026,66%
111Sweden25040,00%
111Finland10016,67%
222Finland20025,00%
222Iceland20025,00%
222Sweden40050,00%
333Denmark10020,00%
333Sweden40080,00%

 

Thank you in advance 🙂

Best regards!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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])))

View solution in original post

3 REPLIES 3
nbrandborg
Helper II
Helper II

@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 numberCountrySalesPercentageRank
111Denmark10016,67%3
111Norway15026,66%2
111Sweden25040,00%1
111Finland10016,67%3
222Finland20025,00%2
222Iceland20025,00%2
222Sweden40050,00%1
333Denmark10020,00%2
333Sweden40080,00%1
amitchandak
Super User
Super User

@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!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.