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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Aha2022
Regular Visitor

Unit sales by product formula

Hello

I have a table shows the products name and I want to know what is the product percentage from all the quantity sold.

the formula is Unit Sales by Product (%) = Product Quantity Sold/ total Quantities Sold  

but I dont know how to write it as a measure. I need your help

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

To your visual, drag the product name column from the Data Table and write these measures

Qty sold = sum(Data[Quantity])

Qty sold across all products = calculate([Qty sold],all(Data[Product name]))

Qty sold (%) = divide([Qty sold],[Qty sold across all products])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Aha2022 ,

 

measure = 
var Product Quantity Sold = calculate(sum(sales),allexcept(table,[product]))

var total Quantities Sold = calculate(sum(sales),all(table))

return
Product Quantity Sold/Quantities Sold

 

Best Regards,

Jay

Ashish_Mathur
Super User
Super User

Hi,

To your visual, drag the product name column from the Data Table and write these measures

Qty sold = sum(Data[Quantity])

Qty sold across all products = calculate([Qty sold],all(Data[Product name]))

Qty sold (%) = divide([Qty sold],[Qty sold across all products])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@Aha2022 , The measure should be

 

Unit Sales by Product (%) = Divide(Sum(Table[Product Quantity Sold]), Sum(Table[total Quantities Sold])) 

 

 

Assume above are columns

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.