Forum Discussion
Subtotals on Matrix Report
- 6 years ago
To achieve your desired output as it looks on the picture you've posted follow these steps:
1) your Matrix should have Warehouse, Location and Items in the Rows and Qty, Cost and Value in the Values area
(this Cost column may have to be replaced by a Measure like the one below)
2) so select your Matrix and then click the Format button (Paint Brush)
3) open the Row Headers options => toggle Stepped Layout => Off => close the Row Headers options
3) open the Subtotals options => in Row subtotal label => replace the Total text => type Sub-Total
4) while still in the Subtotals options => scroll down to the bottom option => Per row level and turn it On
5) you will now see 3 addtional options to control the labels and subtotals for Warehouse, Location and Item
6) turn Off both Warehouse and Location (you only want Subtotals at the Item level so leave those on)
That should do it! 🙂
If you get a subtotal for the Cost which you don't want to show you can write a simple Measure to use instead.
Cost Measure = IF ( HASONEVALUE ( 'Table'[Item] ), MIN ( 'Table'[Cost] ), BLANK() )Hope this helps!
- 6 years ago
Hi onbi,
The reply of Sean made me realize I didn't understood the real issue. I have created a PBIX file that contains your desired matrix, you can download it here: https://1drv.ms/u/s!Ancq8HFZYL_aiIw_YXDrEgo8Q5u5lg?e=SHj3pp
The matrix in the PBIX file looks like this:
Let me know if you need any more help 🙂 And thanks Sean !
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
Sorry, I should've provided the current report vs. desired output via mock up data to help explain the problem. Below is the current report output vs. what I want out of sub-total feature on matrix report.
Current Output
| Warehouse | Location | Item | Qty | Cost | Value |
| Toronto | ABC | 123 | 1 | 29 | 29 |
| 345 | 2 | 10 | 20 | ||
| EFG | 923 | 1 | 89 | 89 | |
| 846 | 3 | 20 | 60 | ||
| 345 | 10 | 17 | 170 | ||
| RIT | 920 | 1 | 12 | 12 | |
| 809 | 5 | 70 | 350 | ||
| Sub-Total | 23 | 247 | 730 |
Desired Output
| Warehouse | Location | Item | Qty | Cost | Value |
| Toronto | ABC | 123 | 1 | 29 | 29 |
| 345 | 2 | 10 | 20 | ||
| Sub-Total | 3 | 49 | |||
| EFG | 923 | 1 | 89 | 89 | |
| 846 | 3 | 20 | 60 | ||
| 345 | 10 | 17 | 170 | ||
| Sub-Total | 14 | 319 | |||
| RIT | 920 | 1 | 12 | 12 | |
| 809 | 5 | 70 | 350 | ||
| Sub-Total | 6 | 362 |
To achieve your desired output as it looks on the picture you've posted follow these steps:
1) your Matrix should have Warehouse, Location and Items in the Rows and Qty, Cost and Value in the Values area
(this Cost column may have to be replaced by a Measure like the one below)
2) so select your Matrix and then click the Format button (Paint Brush)
3) open the Row Headers options => toggle Stepped Layout => Off => close the Row Headers options
3) open the Subtotals options => in Row subtotal label => replace the Total text => type Sub-Total
4) while still in the Subtotals options => scroll down to the bottom option => Per row level and turn it On
5) you will now see 3 addtional options to control the labels and subtotals for Warehouse, Location and Item
6) turn Off both Warehouse and Location (you only want Subtotals at the Item level so leave those on)
That should do it! 🙂
If you get a subtotal for the Cost which you don't want to show you can write a simple Measure to use instead.
Cost Measure = IF ( HASONEVALUE ( 'Table'[Item] ), MIN ( 'Table'[Cost] ), BLANK() )Hope this helps!
- onbi6 years agoHelper I
Thank you Sean for the detailed steps. Yes, I later realized that in order to group by location and have sub-total, I need to have sub-total at Item level. I think. its just the way the grouping is performed by Power BI on Matrix report.
Based on the DAX expression for not displaying the sub-total for the cost, I believe that, there is no switch to turn of the sub-total for a particular value in the report.