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
Anonymous
Not applicable

How to divide each row in a column by the sum of all rows within a group (Calculated column)

Hello,

 

I would like to know how to calculate the ratio of each row divided by the sum of the same rows within a group using calculated column.

Regards,

projectskeyfiscalPeriodForecast DistributionSum of Forecast DistributionFactor
12996472020010.011.230.00813
12996472020020.041.230.03252
12996472020030.081.230.065041
12996472020040.151.230.121951
12996472020050.221.230.178862
12996472020060.221.230.178862
12996472020070.221.230.178862
12996472020080.151.230.121951
12996472020090.081.230.065041
12996472020100.041.230.03252
12996472020110.011.230.00813
12996472020120.011.230.00813
13014202020010.011.150.008696
13014202020020.041.150.034783
13014202020040.151.150.130435
13014202020050.221.150.191304
13014202020060.221.150.191304
13014202020070.221.150.191304
13014202020080.151.150.130435
13014202020090.081.150.069565
13014202020100.041.150.034783
13014202020110.011.150.008696
13014202020120.011.150.008696
1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Try

Column = 'Table'[Forecast Distribution]/CALCULATE(SUM('Table'[Forecast Distribution]),ALLEXCEPT('Table','Table'[projectskey]))

5.PNG 

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous ,

use all except

example

calculate(sum(Table[column),allexcept(Table,Table[projectskey]))

 

Also, refer

https://community.powerbi.com/t5/Desktop/Percentage-of-subtotal/td-p/95390

Anonymous
Not applicable

Here's the Dax that give me the results of the 5th column.

Base Forecast Distribution Per Project =

calculate(sum('Project''s Info'[Target % Revenue Completed]),allexcept('Project''s Info','Project''s Info'[projectskey],'Project''s Info'[fiscalPeriod]))/
calculate(sum('Project''s Info'[Target % Revenue Completed]),allexcept('Project''s Info','Project''s Info'[projectskey]))

Thanks you very much for your help.

Hi @Anonymous ,

 

Try

Column = 'Table'[Forecast Distribution]/CALCULATE(SUM('Table'[Forecast Distribution]),ALLEXCEPT('Table','Table'[projectskey]))

5.PNG 

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Anonymous
Not applicable

This Dax gives me the 4th column .  I wonder if it is possible to divide the 3th column by the 4 th column to obtain the results show in the 5th column without generating a circular dependency.

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.