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
bclark
Regular Visitor

How to Compare Department Sales vs Total Company Sales for Non-Sales Departments

Hello, 

I'm trying to create a matrix that shows department sales and payroll. If the department makes sales, then it should only show their sales. If the department does not make sales (like Admin or Maintenance), then it should show total sales. 

 

I was able to show this using the following measures. 

Total Sales = CALCULATE(Sales[Sales], All(Branches[Department]))
Sales by Department = IF(ISBLANK(Sales[Sales]),  [Total Sales], Sales[Sales])
 
And it worked, giving me this: 
bclark_0-1691155001292.png

 

However, I have now been asked to show "Packing" department sales as only a few different order types, instead of the total company sales. The rest of the non sales departments will still show total sales. 

 

I thought something like this would work: 

Packing Sales = CALCULATE(Sales[Sales], Sales[Order Type] = "Web" || Sales[Order Type] = "Service Center" || Sales[Order Type] = "Corporate")
 
Sales by Department = IF(ISBLANK(Sales[Sales]), If(CONTAINS(Branches, Branches[Department], "Packing"), [Packing Sales], [Total Sales]), Sales[Sales])
 
But it just shows Packing as blank now: 
bclark_1-1691155177033.png

Any thoughts on how I could do this? 

 

Thanks!

 
 
 
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.