Forum Discussion
Matrix data presentation for different groups
Hello Guru's
I am new to power Bi and truing to work on Matric display.
I have data for differnt groups with differnt types, I need to present data in Matrix table on individual section. instead of creating multiple measures for each group is there any smart way that we can write single query to show details for individually.
Thanks for your support
example
data table
| Group | Type | Count |
| 816C | A | 5 |
| 816C | A | 3 |
| 816C | A | 4 |
| 995B | A | 2 |
| 995B | A | 7 |
| 995B | A | 8 |
| 816C | C | 3 |
| 995B | C | 6 |
| 816C | D | 1 |
| 816C | D | 0 |
| 995B | D | 5 |
| 995B | D | 2 |
| 995B | D | 7 |
| 995B | S | 3 |
| 995B | S | 5 |
Expected result
| Group | Type | Count |
| 816C | D | 1 |
| 816C | A | 12 |
| 816C | C | 3 |
| 816C | Total | 16 |
| 995B | D | 7 |
| 995B | A | 17 |
| 995B | C | 6 |
| 995B | S | 8 |
| 995B | Total | 38 |
Hi Vemul
You can use a matrix visual with an impicit measure
or an explicit one that sums the count column
Sum of Count = SUM ( 'Table'[Count] )This aside, your expected result doesnt match your sample data. 995B should be 45 and not 38
7 Replies
- MasonMASuper User
I'd suggest you keep using Matrix table even though it does not render exactly the same format as in your second picture.
I'd also recommend using Outline for Layout, disabling '+/- icon' under Row Header and only showing Subtotal for Row level 'Type'.
- Ray_MindsSolution Supplier
Hi Vemul
Create a Measure on the Count ColumnGo to the Modeling tab in Power BI and create a new measure using the formula below:
Total Count = SUM(Table[Count])
This measure will calculate the total count for each combination of Group and Type.
- Select the Matrix visual and add it to your report canvas.
- Drag and drop the Group column, then the Type column under the Rows section and, Drag and drop the measure Total Count into the Values section.
- rohit1991Super User
Hi Vemul ,
You can achieve this in Power BI without creating multiple measures by leveraging the built-in Matrix visual and DAX’s “Show Values as” options.
Here’s how you can do it:
-
Load your data into Power BI as a simple table (as in your example).
-
Create a Matrix visual:
-
Drag the Group field into the Rows area.
-
Drag the Type field below Group in the Rows area (to create a hierarchy).
-
Drag the Count field into the Values area and set the aggregation to Sum (default).
-
-
Enable subtotals to get the “Total” row for each group:
-
Click on the Matrix visual, go to the Format pane, and expand the “Subtotals” section.
-
Turn on “Row subtotals.” This will automatically show totals for each group, just as you expect.
-
-
No need to create extra measures—Power BI Matrix will sum up the counts by Group and Type, and add totals for you.
-
- v-saisrao-msftCommunity Support
Hi Vemul,
I hope you had a chance to review the solution shared by danextian MasonMA rohit1991 . If it addressed your question, Consider accepting the helpful response as solution it helps others find answers more quickly.
If you're still facing the issue, feel free to reply, and we’ll be happy to assist further.Thank you.
- v-saisrao-msftCommunity Support
Hi Vemul,
checking in to see if your issue has been resolved. If the response provided was helpful, kindly mark the helpful reply as the solution so that others with the same issue can benefit.
let us know if you still need assistance.Thank You.
- v-saisrao-msftCommunity Support
Hi Vemul,
We haven’t heard back from you in a while. If your issue has been resolved, Mark the relevant response as the solution to help fellow community members.
If you still need support, let us know if you still need assistance.Thank You.