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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
AndrewPF
Helper V
Helper V

merging direct query queries

I have a number of Direct Query queries in my Data Transform view.  It works fine until I try to put a merge in one of them. 

 

I have found a workaround which is to simply duplicate the query, then apply the merge to the duplicate. 

 

However, the error message is a little strange: "Query [TABLE NAME] (step 'Merged Queries') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.".  

 

Is this the best way around the problem?  Is there a neater solution? 

 

Does the error message I'm getting correctly reflect the problem I'm having? 

5 REPLIES 5
v-pgoloju
Community Support
Community Support

Hi @AndrewPF,

 

Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to @Natarajan_M and @BeaBF  for prompt and helpful responses.

 

Great to hear that it’s working as expected on your end!

This behavior is due to a Direct Query limitation related to Power BI’s data privacy (firewall), where the engine cannot guarantee that both queries come from the same source, which blocks the merge operation.

Switching to Import mode removes this restriction, which is why your approach works fine.

 

I’d suggest marking your approach as the solution so it can help others facing the same Direct Query firewall limitation.

 

Thanks & Regards,

Prasanna Kumar

AndrewPF
Helper V
Helper V

Thank for your replies but I'm still getting issues even when I use the duplicates solution.  I have changed the DQ to import and the problem has gone.  As far as I can gather, my data will still refresh (I don't need it in real time). 

@AndrewPF : This error is specific to the Direct query mode as PBI engine cant confirm if they are from the same source and it will work without any issues for Import mode.

Thanks
If this response was helpful in any way, I’d gladly accept a kudo.
Please mark it as the correct solution. It helps other community members find their way faster.

BeaBF
Super User
Super User

@AndrewPF 

Yes, the error message is basically pointing to the right issue.

What’s happening is that when you add a merge in DirectQuery, Power Query can treat it as a “data combination” and the privacy/firewall logic kicks in. That’s why it complains about referencing other queries.

Your workaround (duplicate + merge) works, but it’s more of a patch than a clean solution.

Cleaner options would be:

  • If both tables come from the same source, do the join directly at the source (e.g. SQL view) → best for DirectQuery

  • Or make sure the merge can fully fold (same source, simple steps, no intermediate query dependencies)

  • Also check privacy levels, as mismatches can trigger this exact error

BBF


💡 Did I answer your question? Mark my post as a solution!

👍 Kudos are appreciated

🔥 Proud to be a Super User!

Community News image 1920X1080.png
Natarajan_M
Solution Supplier
Solution Supplier

Hi @AndrewPF ,

I believe PBI's Firewall is blocking the merge by assuming that it involves two different query contexts, because it cant guarante that they are from the same source.

QQ : can you push the merge into the DB joins if the tables are coming from the same source ?
Also did you check whether you are getting the same error when you reference the query instead of the duplicate ?

Thanks 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.