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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
njcgante
Regular Visitor

Power Query merge partially overlapping queries without nulls

I have two queries from two different sources. There are a couple overlapping columns from each that i'm attempting to use to combine them into one table. Basically I need all the info from both in order to do some comparison.  For the sake of discretion, here are sample tables that convey what I'm trying to do:

 

Recipe Table - Used to quantify how much is supposed to be used for each product

ProductIngredientRequired
CakeChocolate5
CakeEgg1
CakeFlour3
CakeSugar1
CakeWater0.5
MuffinCinnamon0.1
MuffinEgg2
MuffinFlour4
MuffinSugar2
MuffinWater0.5

 

Actual Use Data - what the new baker actually used by invoice

InvoiceProductIngredientActual
AMuffinEgg3
AMuffinSugar2
AMuffinWater0.5
BCakeChocolate5
BCakeEgg1
BCakeFlour1
CMuffinChocolate2
CMuffinSugar1
CMuffinWater1

 

End Result I'm looking for:

InvoiceProductIngredientActualRequired
AMuffinCinnamon00.1
AMuffinEgg32
AMuffinFlour04
AMuffinSugar22
AMuffinWater0.50.5
BCakeChocolate55
BCakeEgg11
BCakeFlour13
BCakeSugar01
BCakeWater00.5
CMuffinChocolate20
CMuffinCinnamon00.1
CMuffinEgg02
CMuffinFlour04
CMuffinSugar12
CMuffinWater1

0.5

 

So, I'm trying to create rows for each of the following:

1. Matching data in both tables

2. Ingredients not used that are in the recipe (Actual = null and Required = something)

3. Ingredients used that are not in the recipe (Required = null and Actual = something)

 

I've been able to create #1 & #3 with a left outer join. I've tried multiple combinations of joins and anti-joins to create #2, but have been unsuccessful. No matter what I try, i can't associate an invoice to something with no Actual data. How can I accomplish this?

 

1 REPLY 1
lbendlin
Super User
Super User

The best you can do is a full outer join.

lbendlin_0-1698007877546.png

 

No matter what I try, i can't associate an invoice to something with no Actual data. How can I accomplish this?

 

Well, it is called Reality for a reason. If there are no actuals then there is no invoice.  

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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