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