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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
marianamarques
Advocate I
Advocate I

Calculate % of a total

Hello everyone,

I'm trying to calculate the % of sales to a specific customer compared to the total sales.

This is what I have on my table: total sales, quantity, date, item code, customer id

 

Does anyone know an easier way to compare each item sales for that specific client x the total sales? I was wondering if I could create a measure that filers the client code already or if I should create another table filtering that specific client code (our biggest customer) and relate the two tables (specific client x total).

Thank you!!! 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @marianamarques

 

If I understand your purpose completely, you want two measures. One measure, which receives filters, and another measure, which doesn't receive filters. So I would make these measures:

 

Total sales = CALCULATE(SUM(Table[total sales]); ALL(Table[Customer Id]))

 

Sales = SUM(Table[total sales])

 

Sales / Total sales = [Sales] / [Total sales]

 

The Sales / Total sales-measure will be 1 if you do not filter on anything. If you, however, filter on a specific customer id, the Sales-measure will adjust, and the Sales / Total sales-measure will no longer be 1, but a fraction of 1.

 

Does this make sense? Let me know, if you want me to elaborate on anything and also whether it works or not.

 

Best

Martin

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @marianamarques

 

If I understand your purpose completely, you want two measures. One measure, which receives filters, and another measure, which doesn't receive filters. So I would make these measures:

 

Total sales = CALCULATE(SUM(Table[total sales]); ALL(Table[Customer Id]))

 

Sales = SUM(Table[total sales])

 

Sales / Total sales = [Sales] / [Total sales]

 

The Sales / Total sales-measure will be 1 if you do not filter on anything. If you, however, filter on a specific customer id, the Sales-measure will adjust, and the Sales / Total sales-measure will no longer be 1, but a fraction of 1.

 

Does this make sense? Let me know, if you want me to elaborate on anything and also whether it works or not.

 

Best

Martin

Thank you Martin! It worked perfectly!

Anonymous
Not applicable

I'm glad it worked out for you! Best of luck in the future.

 

Best

Martin

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors