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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Calculated measure

Capture.JPG

 

 

I need to calculate a new measure which allows me to calculate the weight to each country excluding the cash weight. In the example above the country allocation is 95.73% and there is therefore 4.27% cash in the portfolio. I need to divide each country weight by 0.9753 so that the country weight sums to 100%. How can I write a new measure to calculate that?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Superb! I'm never going to admit how long that took!!! I now have to understand the use of divide in your example why not use / ?

 

 

View solution in original post

3 REPLIES 3
MattAllington
Community Champion
Community Champion

Try this pattern

 

Total=calculate(sum(table[weight]),all(table[country]))

new percent = divide(sum(table[weight]),[Total])



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

Superb! I'm never going to admit how long that took!!! I now have to understand the use of divide in your example why not use / ?

 

 

Divide has an auto "divide by zero error" protection built in. I just use it routinely rather than / even if there is no chance of div 0 errors. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.