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

Dividing column by Grand Total from another column

So I have store sales numbers for this year and last which allow me to easily calculate YOY%. I am now trying to get a sales contribution column. By this I mean, in terms of bps, how much each store contributed to the region's sales growth. I've attached a basic sample table in excel where I've easily calculated this. 

Sample Sales Table.jpg

 

In Power BI, I am using slicers/filters because we have numerous regions etc. I created a measure that uses the calculate function but then it doesn't adjust dynamically based on the filters. I truly appreciate any help!

3 REPLIES 3
harshnathani
Community Champion
Community Champion

Hi @p0s01si ,

 

Try this.

 

 

 

Sales Contribution = 
IF(ISINSCOPE(Geography[Store]),DIVIDE([YOY Difference], CALCULATE([Total Sales],ALL(Geography[Store]))))

 

 

 

1.jpg

 

 

 

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

 

Anonymous
Not applicable

Hi,

You can create a region total calculated column like below.

 

Region Total = var region = 'Table'[Region] return CALCULATE(SUM('Table'[Sales LY]),FILTER('Table','Table'[Region]=region))

 

and then create a sales contribution column

Sales Contribution = 'Table'[Delta]/'Table'[Region Total]
You can check it will work with both region/store slicer.
 
Please like if it helped you.
 
Thanks,
Sumeet
 

 

 

sturlaws
Resident Rockstar
Resident Rockstar

Hi,  you are refering to a measure which uses the calculate function, which is a bit unclear. Could you post the code for this measure?

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.

Top Solution Authors