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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Calcullate All/Filter

Hello,

 

I need to create a measure to calculate the % of grand total. Let me explain you what I mean

 

 

 

Product     Amount      Total Sales(Measure I need)         % Grand Total (2nd Measure needed)   

 

A               100                            200

B                 75                            200

C                 25                            200

 

Total = 200

 

This data example is not filtered by any field. What I need is the "200" changes depending on the filters applied, so i can get the % total for every field (either by supervisor, country, department, etc.)

 

Thanks

 

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous 

To get the grand total, you would do something like this:

Total Sales = 
Calculate(
    SUM('YourTable'[Amount]),
    ALL('YourTable')
)

Then, to get the % of the total, you can do:

% Grand Total = 
DIVIDE(
    SUM('YourTable'[Amount]),
    [Total Sales]
)

 

I hope this helps. If it does, please Mark as a solution.
I also appreciate Kudos.
Nathan Peterson
Anonymous
Not applicable

@Anonymous  Hey, i already tried that but what it gives me is the TOTAL amount of calls (in my case is around 100,000) So, it will divide the amount of calls per agent by the TOTAL 100,000 calls, and that's not what I need, what I need is to have that amount filtered by agent or sup or country, instead of the 100,000 i need for example the total calls per AGENT, idk if that makes sense

hi @Anonymous 

You need to adjust the formula by using ALLEXCEPT Function instead of ALL Function.

https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors