Power BI is a business analytics service provided by Microsoft that enables users to analyze data and share insights. Power Query is a data connection technology that allows you to import and transform data from various sources. Snowflake is a cloud-based data warehousing platform that provides scalable data storage and processing capabilities. In this article, we will discuss Power Query M Language code for connecting to the Snowflake data source from inside Power BI.



Before we begin, ensure that you have the following:

– A Snowflake account

– A Power BI account

– The ODBC driver for Snowflake installed on your computer

Connecting to Snowflake from Power BI


To connect to Snowflake from Power BI, follow these steps:

1. Open Power BI and click on the ‘Get Data’ button in the ‘Home’ tab.

2. In the ‘Get Data’ window, select ‘ODBC’ from the list of available data sources.

3. In the ‘ODBC’ window, select the ‘Snowflake‘ data source and click on the ‘Connect’ button.

4. In the ‘Navigator’ window, select the schema and table that you want to import data from and click on the ‘Edit’ button.

5. In the ‘Power Query Editor’ window, you can transform and clean up the data as required.

Power Query M Language Code

Power Query uses the M language to perform data transformations and manipulations. The following Power Query M Language code can be used to connect to Snowflake from inside Power BI:


Source = Odbc.DataSource(“dsn=Snowflake“, [HierarchicalNavigation=true]),

#”dsn=Snowflake” = Source{[Name=”dsn=Snowflake“]}[Data],

db = #”dsn=Snowflake“{[Schema=”DATABASE_NAME”]}[Data],

#”dbo_SCHEMA_TABLE” = db{[Schema=”SCHEMA_NAME”,Item=”TABLE_NAME”]}[Data]



In the above code, replace ‘dsn=Snowflake‘ with the name of your Snowflake ODBC driver. Replace ‘DATABASE_NAME’, ‘SCHEMA_NAME’, and ‘TABLE_NAME’ with the names of your Snowflake database, schema, and table respectively.


In this article, we discussed how to connect to the Snowflake data source from inside Power BI using Power Query M Language code. We also saw the prerequisites required for the same. By following the steps and using the Power Query M Language code provided, you can easily import and transform data from Snowflake into Power BI for analysis and reporting.

Power BI Training Courses by G Com Solutions (0800 998 9248)

Contact Us


    Your Name (required)


    Email (required)


    Training Course(s)

    Your Message

    Upload Example Document(s) (Zip multiple files)

    Similar Posts