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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
shuberml
Frequent Visitor

Sum By Row

Hello! 

 

Need help with the correct approach to do the following. I have a table that looks like: 

StoreStateProductSales
ACAApple5
ACAPear1
ACAOrange1
ACACelery5
BCAApple5
BCAPear5
BCAOrange5
BCACelery1
CTXApple5
CTXPear5
CTXOrange4
CTXCelery1

 

I'd like to add rows with the sum of the fruits:

 

ACAFruit7
BCAFruit15
CTXFruit14

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @shuberml 

Create a table with category and product as below, then relate two tables with "product" column,

Capture1.JPG

Add columns into matrix and select "sum" aggregation, set filters as below:

Capture2.JPGCapture3.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
shuberml
Frequent Visitor

Thank you both! Used the second solution, but both were effective!

v-juanli-msft
Community Support
Community Support

Hi @shuberml 

Create a table with category and product as below, then relate two tables with "product" column,

Capture1.JPG

Add columns into matrix and select "sum" aggregation, set filters as below:

Capture2.JPGCapture3.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@shuberml , You need to define a category fruit / not fruit, and then it a simple sum.

This can be calculated column

Type = if([Product]<>"Celery","Fruit","Not Fruit")

Then you can filter on Fruit.

 

Or you can try SEGMENTATION

https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-po...
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors