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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.