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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
TheBrummieGuy
Frequent Visitor

How to sum a column filtered by a categorical column in the same table in Power Bi?

I'm trying to get a sum of my sales figures by the product category from the a column in the same table

The original data is below.

 

Location idProduct typeSales
224Boots£42
746Hat£74
845Jumper£26
942Hat£12
224Boots£14
224Jumper£28
746Boots£61

 

And what I'm trying to get is below, I am having trouble getting the right numbers for the last three columns

 

Location idTotal SalesBoots SalesHat salesJumper Sales
224£84£56£0£28
746£135£61£74£0
845£26£0£0£26
942£12£0£12£0

 

I have tried the following code:

Boots_Sales = CALCULATE( SUM(Sheet1[Sales]), FILTER(Sheet1,Sheet1[Product_Type]="Boots"))

 

Thanks

1 ACCEPTED SOLUTION

thank @themistoklisfor the reply i needed in a column to do more working out  from that column. I have now found a solution by using the same formula as a above bt for a measure instead of a  column.

 

Thanks

View solution in original post

2 REPLIES 2
themistoklis
Community Champion
Community Champion

@TheBrummieGuy

 

You need to write a formula.

 

Simply put the columns to a matrix 

Image below:

image.png

thank @themistoklisfor the reply i needed in a column to do more working out  from that column. I have now found a solution by using the same formula as a above bt for a measure instead of a  column.

 

Thanks

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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