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
Anonymous
Not applicable

Referencing a table and column in SQL statement for inner join

Hi there

 

I have a HUGE dataset over 10 million rows and a small dataset of 2501 rows.

I need to do an inner join from the small to the large - so I only get matching rows from the large dataset based on Invoice ID, that way I don't bring in the entire large dataset.

 

The large dataset is called stg.vw_ActrlMthlyClaimSnapshot and Invoice ID is "Invoice ID"

The small dataset is called "OverPayments" - which I've already imported into Power BI so it's an existing table and Invoice ID is called "InvoiceId"

 

Below is my attempt at SQL but I'm not referencing the OverPayments table or Invoice ID column correctly. Help!

 

select*from stg.vw_ActrlMthlyClaimSnapshot
inner join Table.OverPayment 
on "Invoice ID" = STG.vw_ActrlMthlyClaimSnapshot.InvoiceId

 

 

 

 

 

6 REPLIES 6
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

You can use Merge Queries, if you getting your data from SQL server it will perform Query folding.

image.png

You can check your SQL syntax by clicking on "View Native Query" 

image.png

Regards,
Mariusz

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

Anonymous
Not applicable

@Mariusz  sadly view native query is greyed out for the merge step. 

 

Basically, if I knew how to reference the OverPayment table and the InvoiceId column in a SQL statement, it should work. I've tried Table.OverPayment and that doesn't work either. 

 

I absolutely don't want to import the entire huge dataset and perform a merge within PBI. 

Hi @Anonymous 

 

Please check how you importing your tables, do you just select them from the list or do you write a sql do it?

Some of the transormations are not suported by Query Folding so its importent to make the merge before you insert any function that can not be translated to a native langage.

Please check this article and video
https://exceleratorbi.com.au/how-query-folding-works/

Regards,
Mariusz

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

Anonymous
Not applicable

The huge table is on a SQL server, so I can use the SQL editor within Power BI to define what I want before I import it. What I want, is an inner join to an existing table within Power BI.

 

I have attempted to define an inner join, however I don't know how to reference the Power BI table called OverPayment.

 

If anyone knows how to reference a table in the SQL query editor, that would be great.


Thanks 🙂 


Anonymous
Not applicable

@Anonymous  did you ever figure out how to do this?

Mariusz
Community Champion
Community Champion

 

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.