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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

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 Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 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.