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

## Sum of a Measure

Hello,

I'm working on Power BI and I am meeting a problem. I created a first measure which calculate the sum of sales by partner :

In this table, I display the top ten of my partners, the total of sale is 100M€. I would like create a second measure which calculate the part of a partner in the total sale (A1 : 6,228,028/100,000,000 = 6.2%). But I don't know howw create a measure which calculate the total sum of sales.

1 ACCEPTED SOLUTION
Super User

Hi @JbPa33
Use  Calculate and ALL dax functions to remove filters from your partner.

something like :

percent from total = divide (sum('Table'[value]),
calculate (sum('Table'[value]), all('Table'[Partner Sale])))

All - removes all the filters from the partners including "top n" that you using so it will calculate the percent from the grand total as you need.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
2 REPLIES 2
Super User

Hi,

Assuming sale is a measure, write these measures

Sale of top 10 partners = SUMX(TOPN(10,all(Data[partners),[sale],desc),[sale])

Contribution (%) = divide([sale],[Sale of top 10 partners])

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Super User

Hi @JbPa33
Use  Calculate and ALL dax functions to remove filters from your partner.

something like :

percent from total = divide (sum('Table'[value]),
calculate (sum('Table'[value]), all('Table'[Partner Sale])))

All - removes all the filters from the partners including "top n" that you using so it will calculate the percent from the grand total as you need.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP

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.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors