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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
FredFred
Frequent Visitor

SQL View created from Visual Query seems to be wrong

Hi Fabricators,

 

we used visual query for complex business logic and tried to translate it via "save as view" to SQL Statement. Turns out the result is not the same as it was in visual query. Strangely, if you load the visualy query into dataflow gen2 the result is correct again. We could not figure out the root of the problem.

 

Do you experience the same?

 

Thanks,

Frederik

1 ACCEPTED SOLUTION
v-csrikanth
Community Support
Community Support

Hi @FredFred 
Thank you for being part of the Microsoft Fabric Community.


The behavior you're describing is likely caused by query caching in Microsoft Fabric’s visual query engine. Even if changes are reflected in the data preview (like when you click into the pop-up editor), when you "Save as SQL View," it may still generate SQL based on the previous cached schema.

  • After editing the source table, refresh the entire visual query (click "Refresh Preview") before saving it again.
  • Alternatively, close and reopen the visual query editor to force a full schema reload.


If the above information helps you, please give us a Kudos and marked the Accept as a solution.
Best Regards,
Community Support Team _ C Srikanth.

View solution in original post

7 REPLIES 7
v-csrikanth
Community Support
Community Support

Hi @FredFred 

It's been a while since I heard back from you and I wanted to follow up. Have you had a chance to try the solutions that have been offered?
If the issue has been resolved, can you mark the post as resolved? If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!
Looking forward to your reply!

Best Regards,
Community Support Team _ C Srikanth.

v-csrikanth
Community Support
Community Support

Hi @FredFred 

We haven't heard from you since last response and just wanted to check whether the solution provided has worked for you. If yes, please Accept as Solution to help others benefit in the community.
Thank you.

If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.

v-csrikanth
Community Support
Community Support

Hi @FredFred 
I wanted to follow up since I haven't heard from you in a while. Have you had a chance to try the suggested solutions?
If your issue is resolved, please consider marking the post as solved. However, if you're still facing challenges, feel free to share the details, and we'll be happy to assist you further.
Looking forward to your response!

Best Regards,
Cheri Srikanth

v-csrikanth
Community Support
Community Support

Hi @FredFred 
Thank you for being part of the Microsoft Fabric Community.


The behavior you're describing is likely caused by query caching in Microsoft Fabric’s visual query engine. Even if changes are reflected in the data preview (like when you click into the pop-up editor), when you "Save as SQL View," it may still generate SQL based on the previous cached schema.

  • After editing the source table, refresh the entire visual query (click "Refresh Preview") before saving it again.
  • Alternatively, close and reopen the visual query editor to force a full schema reload.


If the above information helps you, please give us a Kudos and marked the Accept as a solution.
Best Regards,
Community Support Team _ C Srikanth.

FredFred
Frequent Visitor

Hi @v-csrikanth ,

 

we had done what you propose, i guess. So, this is not the source of the problem. The problem arises when we change one of the source tables. This change is refleceted in the dataflow which opens up by clicking on the pop up window. But if you then save it and then create the SQL View, the changes are not considered. It looks as if the old version was cached (I know that is does not make sense but I just want to try to describe the symptom as good as possible).

 

FredFred_0-1745831589414.png

 

v-csrikanth
Community Support
Community Support

Hi @FredFred 
I wanted to follow up since I haven't heard from you in a while. Have you had a chance to try the suggested solutions?
If your issue is resolved, please consider marking the post as solved. However, if you're still facing challenges, feel free to share the details, and we'll be happy to assist you further.
Looking forward to your response!

Best regards,
Cheri Srikanth

v-csrikanth
Community Support
Community Support

Hi @FredFred 
To resolve the issue where "Show SQL" from a visual query only displays the initial table select, you need to enable load for each applied step in the visual query. This ensures that transformations are reflected when using "Show SQL" or "Save as View." You can also right-click specific steps in the visual query editor and select "View Data Source Query" to inspect SQL for individual transformations.

Note: Reference link which on of the user faces similar kind issue
https://community.fabric.microsoft.com/t5/Data-Engineering/Show-SQL-from-visual-query-not-possible/t...

 

If the above information helps you, please give us a Kudos and marked the Accept as a solution.
Best Regards,
Community Support Team _ C Srikanth.



 

Helpful resources

Announcements
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 FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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