Forum Discussion

gmasta1129's avatar
gmasta1129
Resolver I
2 years ago

Subtract values in same column between different portfolio codes

Hello,

 

I have a report that contains the following columns 

1. Run Date

2. Portfolio Code

3. <121 day value

 

The Power BI report I am creating contains 3 slicers

1. "Run Date" filter

2. "Portfolio Code" filter in Table 1

3. "Portfolio Code" filter in Table 2

 

I am creating two of the same tables and it will look as follows:

Run Date (This is the Slicer) 

3/6/2024

*This slicer should apply to both tables

 

Table 1: 

Portfolio Code (This is the Slicer)

654321

Portfolio Code     <121 Day Value

654321                   $5,000,000

 

Table 2:

Portfolio Code (This is the slicer)

123456

Portfolio Code     <121 Day Value

123456                    $3,000,000

 

The 3rd table should show the difference in "<121 Day value" column between portfolio code "654321" in table 1 and "123456" in table 2 (these are the portolio codes selected in each slicer).  Please note there are over 100 portfolio codes. 

 

Therefore I should see a difference of $2,000,000 (5,000,000 - 3,000,00) in table 3.

 

I am not sure how to write a formula where it compares values in the same exact columns for two different portfolio codes.