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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
mca69
Regular Visitor

Best practise to hide sql query code in report

Hi,

I am currently working on a model to distribute power bi reports based on desktop experience and power BI service as well. The thing is, I would like to hide the sql query code from the report, or any other solution to preserve any access to it. Mostly, I connect reports to sql server databases, on premise as well as online (azure sql database).

Anyone with answer or tip to that ?

Thanks in advance. Very much appreciated.

Regards.

2 ACCEPTED SOLUTIONS
DataInsights
Super User
Super User

@mca69,

 

You could create dataflows that contain SQL, and then connect Power BI Desktop to the dataflows. This would prevent users from being able to access the SQL in Power BI Desktop.

 

https://docs.microsoft.com/en-us/power-bi/transform-model/dataflows/dataflows-introduction-self-serv... 





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

Proud to be a Super User!




View solution in original post

Hi,

First of all, thank you for that particular answer. In addition to be one of the best solutions for hiding SQL script that I tried for a couple of days, I discovered a very powerful funtionnality in data modeling. Sure there must be some disadvantages to use power bi dataflows but till now I haven't find any and I think it is just the best way to model and reuse data.  

View solution in original post

3 REPLIES 3
mca69
Regular Visitor

Hi,

Thanks for the answer. I am going to investigate if dataflows could be a solution. I will let you know.

 

DataInsights
Super User
Super User

@mca69,

 

You could create dataflows that contain SQL, and then connect Power BI Desktop to the dataflows. This would prevent users from being able to access the SQL in Power BI Desktop.

 

https://docs.microsoft.com/en-us/power-bi/transform-model/dataflows/dataflows-introduction-self-serv... 





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

Proud to be a Super User!




Hi,

First of all, thank you for that particular answer. In addition to be one of the best solutions for hiding SQL script that I tried for a couple of days, I discovered a very powerful funtionnality in data modeling. Sure there must be some disadvantages to use power bi dataflows but till now I haven't find any and I think it is just the best way to model and reuse data.  

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.