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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Simon_1981
Frequent Visitor

Power Query - Try inner join if second table exists otherwise skip inner join step

Good morning Power Query experts,

 

I am looking for a way to inner join table A with table B based on the condition that table B exists. 

How can I skip this inner join step if table B does not exist?

(My table B shows data of open orders which might not be existing at some dates, due to all orders being shipped.)

Many regards for your help.

 

Simon 

1 ACCEPTED SOLUTION

The way PQ works is that a query needs to exist. The output of your query will be TableB. If you don't receive TableB, the result of your query should be a blank TableB. 

You will need to write your query in that way only. 

Hence, your query needs to say if no applicable data, then no output. 

Now, if you query churns out a text called "no applicable data", then you query should say

if previous step =  "no applicable data then TableA else your join statement

View solution in original post

3 REPLIES 3
Vijay_A_Verma
Super User
Super User

Use this conditional statememt

= if Table.IsEmpty(TableB) then TableA else your join statement

Hey Vijay, thank you for your fast reply and help. 

Does this also work if table B does not exist at all?

If there currently are no open orders I do not even get a table at all instead I only get a line saying "no applicable data". 

 

Many regards,

 

Simon

The way PQ works is that a query needs to exist. The output of your query will be TableB. If you don't receive TableB, the result of your query should be a blank TableB. 

You will need to write your query in that way only. 

Hence, your query needs to say if no applicable data, then no output. 

Now, if you query churns out a text called "no applicable data", then you query should say

if previous step =  "no applicable data then TableA else your join statement

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors