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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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

Hi @Anonymous ,

 

Try

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

5.PNG 

 

Best Regards,

Jay

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
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.
Anonymous
Not applicable

Hi @Anonymous ,

 

Try

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

5.PNG 

 

Best Regards,

Jay

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.