Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello!
Need help with the correct approach to do the following. I have a table that looks like:
| Store | State | Product | Sales |
| A | CA | Apple | 5 |
| A | CA | Pear | 1 |
| A | CA | Orange | 1 |
| A | CA | Celery | 5 |
| B | CA | Apple | 5 |
| B | CA | Pear | 5 |
| B | CA | Orange | 5 |
| B | CA | Celery | 1 |
| C | TX | Apple | 5 |
| C | TX | Pear | 5 |
| C | TX | Orange | 4 |
| C | TX | Celery | 1 |
I'd like to add rows with the sum of the fruits:
| A | CA | Fruit | 7 |
| B | CA | Fruit | 15 |
| C | TX | Fruit | 14 |
Solved! Go to Solution.
Hi @shuberml
Create a table with category and product as below, then relate two tables with "product" column,
Add columns into matrix and select "sum" aggregation, set filters as below:
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.
Thank you both! Used the second solution, but both were effective!
Hi @shuberml
Create a table with category and product as below, then relate two tables with "product" column,
Add columns into matrix and select "sum" aggregation, set filters as below:
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.
@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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 137 | |
| 102 | |
| 71 | |
| 67 | |
| 65 |