Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

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.

 

 C1C2C3C4
R1100200500200
R2200300600100
R3300400800100
R44005001000100
1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community 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:

Screenshot 2020-09-28 104318.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community 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:

Screenshot 2020-09-28 104318.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

amitchandak
Super User
Super 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

https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1354591

https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/963588#M428

 

Also, vote for this idea

Hybrid Table
https://ideas.powerbi.com/ideas/idea/?ideaid=9bc32b23-1eb1-4e74-8b34-349887b37ebc

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.