Forum Discussion

Sagejah9's avatar
Sagejah9
Icon for Helper III rankHelper III
5 years ago
Solved

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

StudentNameSubjectASubjectBSubjectCSubjectDMeasure
John Doe43633.5
Peter 24322
Mark20022

 

Measure =(Calculate(sum('StudentSheet'[Value]),'StudentSheet'[Attribute]="SubjectA")+Calculate(sum('StudentSheet'[Value]),'StudentSHeet'[Attribute]="SubjectD"))/2

unpivot table - StudentSheet

 

StudentNameAttributeValue
John SubjectA4
Peter SubjectA2
MarkSubjectA2
JohnSubjectB3
PeterSubjectB4
MarkSubjectB0
JohnSubjectC6
PeterSubjectC3
MarkSubjectC0
JohnSubjectD3
PeterSubjectD2
MarkSubjectD2
  • Anonymous's avatar
    Anonymous
    5 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