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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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