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
Mahadevaraobc
Helper II
Helper II

Variance calculation

Hi Everyone,

Im having difficulty in achieving the following, please help.



I have created a Table visual as below.



Country Serial No actual budget diff %
USA ? 89 78 -11 -14.10%
USA AA 7 6 -1 -16.67%
USA AB 2 3 1 33.33%
USA BC 12 7 -5 -71.43%
USA DD 453 461 8 1.74%
USA FF 196 216 20 9.26%
USA GG 183 170 -13 -7.65%
USA HH 12 14 2 14.29%
USA II 1 1 0 0.00%
USA JJ 10 7 -3 -42.86%
USA KK 210 247 37 14.98%
USA LL 146 146 0 0.00%
USA MM 4067 4093 26 0.64%
USA NN 1 1 0 0.00%
canada ? 1045 918 -127 -13.83%
canada AA 1 5 4 80.00%
canada AB 86 40 -46 -115.00%
canada BC 1999 1899 -100 -5.27%
canada DD 4 2 -2 -100.00%


What i want is:

1) When no county is selected all serial number values should be summed up and show diff and diff in %

2) if any country is selected only serial numbers to that country should be summed and diff and diff in % should be shown
1 ACCEPTED SOLUTION

I assume the % is the issue. You will need SUMX for the diff column, then the % will work. 

 

https://exceleratorbi.com.au/use-sum-vs-sumx/

 

the complication is you have 2 columns that define the unique list (country and serial).  The correct formula depends on you table structure. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

1 REPLY 1

I assume the % is the issue. You will need SUMX for the diff column, then the % will work. 

 

https://exceleratorbi.com.au/use-sum-vs-sumx/

 

the complication is you have 2 columns that define the unique list (country and serial).  The correct formula depends on you table structure. 



* 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.