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
banteerlass
Frequent Visitor

How do I sum percentages correctly?

Hi,

 

I have got a request from the business that I support to recreate the following in Power BI.  They are assigning a weight to each row (column G). They then use the sum of the overall weight (G9) to get the overall weighted value in red below (H9).  

 

The calculations are as follows:

 

column G is =SUM(C2:E2)

column H is =SUM(C2:E2)/SUM(C2:F2)

cell G9 is =SUM(G2:G9)

cell H9 is =(G2*H2/G10)+(G3*H3/G10)+(G4*H4/G10)+(G5*H5/G10)+(G6*H6/G10)+(G7*H7/G10)+(G8*H8/G10)+(G9*H9/G10)

 

I have tried this numerous ways in Power BI but can't get it to work.  I think I need to get the value in H9 to go row by row somehow?  

 

ABCDEFGH
1QueueA48745941482897218951616953999554700740.888600685
2QueueB8920749217733823573152164065101126728360.946199654
3QueueC2446681121422359563697993804050.056354593
4QueueD2996234732404220513704037039491510.359356063
5QueueE1409574112564108891656718016310290.198949429
6QueueF79251018645862615627064710415830.14244396
7QueueG90166211960651280223485110725480.324287454
8QueueH2224718599494210854179353630350660.628559985
 9     1792526920.892989253

 

Thanks!

1 ACCEPTED SOLUTION
Phil_Seamark
Employee
Employee

Hi @banteerlass

 

I create the following three calculated columns

 

G1 = 'Table1'[C] + 'Table1'[D] + 'Table1'[E]

G9 = CALCULATE(SUM('Table1'[G1]),ALL('Table1'))

H1 = DIVIDE('Table1'[G1] ,  ('Table1'[G1] + 'Table1'[F])) 

H9 = 'Table1'[G1] * 'Table1'[H1] / 'Table1'[G9]

 

H9.png

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
Phil_Seamark
Employee
Employee

Hi @banteerlass

 

I create the following three calculated columns

 

G1 = 'Table1'[C] + 'Table1'[D] + 'Table1'[E]

G9 = CALCULATE(SUM('Table1'[G1]),ALL('Table1'))

H1 = DIVIDE('Table1'[G1] ,  ('Table1'[G1] + 'Table1'[F])) 

H9 = 'Table1'[G1] * 'Table1'[H1] / 'Table1'[G9]

 

H9.png

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi @Phil_Seamark,

 

Thank you so much for this!!  I'll try it and let you know how it goes.  The actual dataset I'm working with is different from the Excel sheet I got from the business though.  Each queue has many rows associated with it.  So I just need to play with your approach a bit to get it to work.  I'll let you know how it goes.  Thanks again! 

How would I do this if there are multiple rows per queue?  Do I need to use CALCULATE?  The example I gave had the summed up numbers per queue.  I've tried your approach but I feel there is something up with my grouping. 

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.