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
Absalon29
Helper III
Helper III

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

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

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.

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.

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.