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

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

Reply
Anonymous
Not applicable

Issue with SQL statement

Hello

 

I use the following SQL statement but it only shows the Table4's values and all the rest values from the fields of the other tables are null.

 

SELECT * FROM Table1
LEFT JOIN Table2
ON Table1.Col1 = Table2.Col2
LEFT JOIN Table3
ON Table2.Col4 = Table3.Col5
RIGHT JOIN Table4
ON Table2.Col6 = Table4.Col7

 

Any idea?

 

Thanks!

5 REPLIES 5
Pragati11
Super User
Super User

Hi @Anonymous ,

 

Not sure if I understand your issue correctly.

 

Are you using this sql query in Power BI or you want to replicate similar query in Power BI?

 

Please add details: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

hi @Pragati11 

 

I am putting this SQL statement in Power BI but it does not produce the result it should. The statement might be wrong, any hint?

 

Thanks

Hi @Anonymous ,

 

Try replacing the highlighted section as shown below with Table3.Col5:

Pragati11_0-1602515085286.png

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi @Pragati11 

 

Thanks but Table4.Col7 can only be joined with Table2.Col6. The Table3.Col5 is not relevant to Table4.Col7.

 

Any other idea?

Hi @Anonymous ,

 

It is very difficult to analyze without looking at the data and just by imagining.

Is this statement correct in SQL?

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
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