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

Adding query in PowerBi Dataflow

I want to create a dataflow by connecting to Snowflake. Is there a way to directly pull the data using a snowflake query ?

When i connect to snowflake database, it directly gives a table without letting me to filter a particular set of data.

10 REPLIES 10
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

As Snowflake is essentially a foldable source, any basic operations you perform on the query in your Dataflow (basic row filters etc.) should be folded to the source, so you're not actually bringing in the whole table then filtering back again, the Dataflow will amend the query actually sent to the source to include your filters.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

Hi @BA_Pete : Actually I want to use a SQL rank function in snowflake query to filter the data which is not possible in PowerBI query. What I want to know is , is there a way to add a custom step which will include the sql query ?

Also, what will be syntax to add the query ?

StoryTeller12_0-1672822612960.png

 

 

To connect using a custom SQL query, you need to use the advanced options in the connction dialog.

When you go to connect to a Snowflake source, you should get a dialog something like this where you can expand the advanced options and enter your own SQL:

BA_Pete_0-1672826521937.png

 

Pete

 



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

Unfortunately the Snowflake Connection dialog does not have an option to enter a query.

 

StoryTeller12_0-1672827040703.png

 

i have the exact same display, different to what PETE shows.

no box to put in SQL Statement. Aug 2024

Hi @DokDok ,

 

The SQL statement option only seems to appear in the Desktop connection.

My suggestion was to use Desktop to create the query required, then use Advanced Editor to copy the M code and paste that into Advanced Editor in a blank query in a Dataflow. This works for other users.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




 

What version of PBI Desktop are you using? The updated Snowflake connector was added in the June 21 release, as per this blog from Snowflake:

BA_Pete_0-1672834082835.png

https://www.snowflake.com/blog/custom-sql-now-supported-in-the-snowflake-connector-for-power-bi/ 

 

And per this article on MS Learn:

BA_Pete_1-1672834264281.png

https://learn.microsoft.com/en-us/power-query/native-database-query 

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

The question refers to Power BI dataflow, not to PowerQuery in Power BI desktop. In a dataflow there isn't this option for some reason

 

Then just do it in Desktop and copy the M code into a blank Dataflow query.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




That worked for me.

Thanks @BA_Pete  🚀 

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.

Top Kudoed Authors