cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper 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

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

3 REPLIES 3
Anonymous
Not applicable

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

Helper I

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.