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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
FsmA
Frequent Visitor

Need to divide a column by subtotal of another column

I have a database of sales and returns for each department of each branch. I am responsible for the data for only one branch, so I can filter the table to only show that one. The columns I have are:

 

Fiscal Year (FY); Branch (BR); Department (Dep); Sales (S); Returns (R)

 

Based on these columns, I can filter Branch to just mine (eg Branch A), show the % Returns for each department (R/S %) , and overall Branch returns (Fiscal Year subtotal of R/S). However, the sales of some departments are much much larger than others. So I want to show the impact of each department on the overall Branch returns year-on-year. So what I need is to divide the "Returns" column by the Fiscal Year subtotal of "Sales".

 

Sample Table: https://i.imgur.com/gHmQ81E.png

 

The pink column is what I want to dynamically calculate, right now it is manually done by dividing the green column by the hard coded number 62912. This does not work for year-on-year trend since the blue number will change for each fiscal year. Ultimately, I want to plot these on a stacked column chart to show Branch overall % Return and each dept's relative contribution to it, similar to this: https://i.imgur.com/6cJs0OY.png.

 

 Update: I figured it out with some googling. In case it helps someone else out, here is the method I used:

 

Weighted_Returns = DIVIDE('Table'[Returns], CALCULATE(SUM('Table'[Sales], ALLEXCEPT('Table'[Branch], 'Table'[Fiscal Year]))))

0 REPLIES 0

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.