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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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