Forum Discussion
adding a measure to matrix column beside a table column
I would like to add a measure to my matrix next to the other columns. If I add the measure to the values tab in the visulation pane. it will fall under each Attribut column in the matrix.
the matrix table I am expecting
| StudentName | SubjectA | SubjectB | SubjectC | SubjectD | Measure |
| John Doe | 4 | 3 | 6 | 3 | 3.5 |
| Peter | 2 | 4 | 3 | 2 | 2 |
| Mark | 2 | 0 | 0 | 2 | 2 |
Measure =(Calculate(sum('StudentSheet'[Value]),'StudentSheet'[Attribute]="SubjectA")+Calculate(sum('StudentSheet'[Value]),'StudentSHeet'[Attribute]="SubjectD"))/2
unpivot table - StudentSheet
| StudentName | Attribute | Value |
| John | SubjectA | 4 |
| Peter | SubjectA | 2 |
| Mark | SubjectA | 2 |
| John | SubjectB | 3 |
| Peter | SubjectB | 4 |
| Mark | SubjectB | 0 |
| John | SubjectC | 6 |
| Peter | SubjectC | 3 |
| Mark | SubjectC | 0 |
| John | SubjectD | 3 |
| Peter | SubjectD | 2 |
| Mark | SubjectD | 2 |
- Anonymous5 years ago
Hi Sagejah9 ,
You can use the subtotals to show the value.
Create the following measure
Measure = IF(ISINSCOPE('Table'[Attribute]),SUM('Table'[Value]),DIVIDE(CALCULATE(SUM('Table'[Value]),FILTER('Table',[Attribute]="SubjectA"||[Attribute]="SubjectD")),2))You can change the name of subtotals.
Check more details from the attchment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- mahoneypat
Microsoft Employee
Adding that beside the others ones can be done with a Calculation Group to create an asymmetric matrix, as described here.
Building a Matrix with Asymmetrical Columns and Rows in Power BI - Excelerator BI
Pat
- AnonymousNot applicable
Hi Sagejah9 ,
You can use the subtotals to show the value.
Create the following measure
Measure = IF(ISINSCOPE('Table'[Attribute]),SUM('Table'[Value]),DIVIDE(CALCULATE(SUM('Table'[Value]),FILTER('Table',[Attribute]="SubjectA"||[Attribute]="SubjectD")),2))You can change the name of subtotals.
Check more details from the attchment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.