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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Calculate the difference between 2 columns in 2 separate tables

Hi there.

 

The screen below shows 2 matrix (from 2 different tables).  I would like to create a 3rd matrix (in the same format as the 1st 2 matrix) whereby I can show for each financial year, the difference between the approved amount and the committed amount.

 

Any suggestio would be much appreciated.

 

Thanks.

 

2 tables..JPG

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

Hi@irisyeong

You can do these like me as below:

Step 1:

Create relationship between two table by year like this:

16.PNG

Step 2:
Add a measure: 
Measure =
CALCULATE (
    SUMX (
        Table1,
        Table1[Qty]
            - CALCULATE (
                SUMX ( RELATEDTABLE ( Table2 ), Table2[Qty] ),
                FILTER ( Table2, Table2[ComFS] = Table1[FundingSource] )
            )
    )
)
Step 3:
Add third matrix
17.PNG
 
Result :
13.PNG

Best Regards,

Lin

 
Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-lili6-msft
Community Support
Community Support

Hi@irisyeong

You can do these like me as below:

Step 1:

Create relationship between two table by year like this:

16.PNG

Step 2:
Add a measure: 
Measure =
CALCULATE (
    SUMX (
        Table1,
        Table1[Qty]
            - CALCULATE (
                SUMX ( RELATEDTABLE ( Table2 ), Table2[Qty] ),
                FILTER ( Table2, Table2[ComFS] = Table1[FundingSource] )
            )
    )
)
Step 3:
Add third matrix
17.PNG
 
Result :
13.PNG

Best Regards,

Lin

 
Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks Lin.  It worked.  Much appreciated.

Hi,

 

I have something similiar. I want to show difference between this two table on a month with graphics preview.

 

Can you help me ?

 

 

table.png

In this case I want to show the diferene for each parameters graphically.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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