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

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

Reply
pranshuagrawal
Regular Visitor

How to get Total of a Measure

I can either use a Categorical Data View Mapping or a Table Mapping, my question is how can I get Total Value of a Measure in my custom visual?

 

For ex. User has entered Region and Sales. And the data looks like

RegionSales
North30000
South20000
East15000
West45000

 

I just want to calculate the total of the sales. (which should be 110,000). I know I can just iterate over this data and add it but this approach fails when I have percentage related data in Measure. For ex:

 

RegionTargetAccomplished
North80%
South70%
East70%
West80%

 

And the total here should be 75% and not 300% (which is what I will get if I am iterating over all the values and summing it up). Let me know if there is anyway to achieve the total if I am using Categorical / Table data view mapping.

2 REPLIES 2
Anonymous
Not applicable

Hi @pranshuagrawal ,

In order to give you suitable soltuion, could you please provide the calculation logic which how to get 75% base on your sample data? Thank you.

75%=xxx/xxx+xxx/xxx+...?

yingyinr_0-1662536032458.png

 

Best Regards

Arul
Super User
Super User

@pranshuagrawal ,

try the below,

Total Sales = SUM('Table'[Sales])
Sales % = 
VAR _Allsales = CALCULATE([Total Sales],ALL('Table'))
return DIVIDE([Total Sales],_Allsales)

Thanks,

Arul

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.