cancel
Showing results for
Did you mean:
Highlighted
Regular Visitor

## 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.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: Calculate the difference between 2 columns in 2 separate tables

Hi@irisyeong

You can do these like me as below:

Step 1:

Create relationship between two table by year like this:

Step 2:
```Measure =
CALCULATE (
SUMX (
Table1,
Table1[Qty]
- CALCULATE (
SUMX ( RELATEDTABLE ( Table2 ), Table2[Qty] ),
FILTER ( Table2, Table2[ComFS] = Table1[FundingSource] )
)
)
)```
Step 3:

Result :

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.
5 REPLIES 5
Community Support Team

## Re: Calculate the difference between 2 columns in 2 separate tables

Hi@irisyeong

You can do these like me as below:

Step 1:

Create relationship between two table by year like this:

Step 2:
```Measure =
CALCULATE (
SUMX (
Table1,
Table1[Qty]
- CALCULATE (
SUMX ( RELATEDTABLE ( Table2 ), Table2[Qty] ),
FILTER ( Table2, Table2[ComFS] = Table1[FundingSource] )
)
)
)```
Step 3:

Result :

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.
Regular Visitor

## Re: Calculate the difference between 2 columns in 2 separate tables

Thanks Lin.  It worked.  Much appreciated.

Frequent Visitor

## Re: Calculate the difference between 2 columns in 2 separate tables

Hi,

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

Can you help me ?

Frequent Visitor

Frequent Visitor

## Re: Calculate the difference between 2 columns in 2 separate tables

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

Announcements

#### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

#### Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

#### Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!