Power BI is known for its powerful data visualization capabilities, but what many users may not realize is that it also has a robust data preparation tool called Power Query. Power Query allows users to connect to various data sources, transform and clean data, and then load it into Power BI for analysis and visualization. In this article, we will focus on one specific data source, the Funnel data source, and show you how to connect to it using Power Query’s M language code.

What is the Funnel Data Source?


The Funnel data source is a popular marketing and sales analytics tool used by many businesses. It allows users to track and analyze their leads or sales Funnel, from the initial stage of awareness to the final stage of conversion. The data collected from Funnel can be invaluable for businesses looking to optimize their marketing and sales strategies.

Connecting to the Funnel Data Source

To connect to the Funnel data source in Power BI, we need to use Power Query and its M language code. Here are the steps to follow:

1. Open Power BI and click on the “Get Data” button on the Home tab.

2. In the “Get Data” window, select “Web” as the data source.

3. In the “From Web” window, enter the following URL: “`“`

4. Click on the “OK” button to proceed.

5. In the “Navigator” window, select the “JSON” option and click on the “Edit” button.

This will open the Power Query Editor, where we can start writing our M language code.

Writing the M Language Code

To connect to the Funnel data source, we need to write the M language code to specify the required parameters. Here is an example of the M language code:


Source = Json.Document(Web.Contents(“”, [

Headers=[Authorization=”Bearer “],

Query=[#”start_date”=”2022-01-01″, #”end_date”=”2022-01-31″]




Let’s break down the code:

– The first line defines a variable called “Source” that will store the data retrieved from the Funnel data source.

– The second line uses the “Web.Contents” function to retrieve the data from the specified URL. Inside the function, we also specify the required headers and query parameters.

– The headers parameter includes the API key that we need to retrieve the data. Replace “” with your actual API key.

– The query parameter specifies the start and end dates for the data we want to retrieve. Replace “2022-01-01” and “2022-01-31” with your desired dates.

Once you have written the M language code, click on the “Done” button to close the Power Query Editor and load the data into Power BI.


In this article, we have demonstrated how to connect to the Funnel data source using Power Query’s M language code. By following the steps outlined above and customizing the M language code with your own API key and date range, you can retrieve valuable data from Funnel and use it to improve your marketing and sales strategies in Power BI.

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