Forum Discussion
Matrix visual column calculation
I have a matrix with column C , rows(column R with values R1,R2,R3 and R4) and amount measure. My matrix looks like below. Column C4 is the calculation I am trying to achieve. C4 = C3- (C1 + C2). C1,C2,C3,C4 are all labels and values of column C. I want to calculate amount measure for C4 such that it fetches corresponding amount for C1,C2 and C3 and perform the required calculation.
| C1 | C2 | C3 | C4 | |
| R1 | 100 | 200 | 500 | 200 |
| R2 | 200 | 300 | 600 | 100 |
| R3 | 300 | 400 | 800 | 100 |
| R4 | 400 | 500 | 1000 | 100 |
Hi Anonymous ,
Create a measure as below:
C4 = VAR _sum=CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[C]="C1"))+CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[C]="C2")) var _sum2=CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[C]="C3")) Return IF(ISINSCOPE('Table'[C]),SUM('Table'[Value]),_sum2-_sum)And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
2 Replies
- amitchandakSuper User
Anonymous , I think you need a hybrid display. That is not available out of the box.
You can refer Blog from Paul and Greg, if those can help
Also, vote for this idea
Hybrid Table
https://ideas.powerbi.com/ideas/idea/?ideaid=9bc32b23-1eb1-4e74-8b34-349887b37ebc - v-kelly-msftCommunity Support
Hi Anonymous ,
Create a measure as below:
C4 = VAR _sum=CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[C]="C1"))+CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[C]="C2")) var _sum2=CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[C]="C3")) Return IF(ISINSCOPE('Table'[C]),SUM('Table'[Value]),_sum2-_sum)And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!