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

Relationship, SUMIF, VLOOKUP and SUBTRACTION

I need some help here as a Power BI beginner. We have 2 sets of data 'Actual' and 'Forecast'. Desired outcome is to calculate the variance between 'Actual' and 'Forecast'. Assuming it is Excel, Step 1 - Identifier is [Subregion]&[BU]&[SpendPoolLow] Could not create relationship between 2 identifiers due to duplicated rows in a file and each other contains identifier not existing in the other file. How to fix this in Power BI? Step 2 - SUMIF based on identifier in both files, and VLOOKUP Step 3 - Manually add in missing identifier in the outcome table, pull down SUMIF function for Actual, VLOOKUP the Forecast value again Step 4 - Subtract Actual from Forecast to calculate variance How to write DAX Step 2-4?
1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

To create a calculated table as a bridge table to have a try.

Table = DISTINCT(UNION(VALUES(Actual[Identifier]),VALUES(Forecast[Identifier])))

Then we can create relationships like this.

rela.PNG

Capture.PNG

 

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

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

To create a calculated table as a bridge table to have a try.

Table = DISTINCT(UNION(VALUES(Actual[Identifier]),VALUES(Forecast[Identifier])))

Then we can create relationships like this.

rela.PNG

Capture.PNG

 

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

Screenshot of error on relationship.screenshot relationship error.png

Attaching the Power BI file... Truly appreciate your help!! Thanks in advanced.

https://drive.google.com/drive/folders/1F0Bu3ZXyNXdhNhJ6AC-elk3YzxmgkHYv?usp=sharing

 

 

Regards,

Joyce

 

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!

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.