Forum Discussion
Want to connect Power BI with API with using Parameter to filter the Dataset
Hi Teams,
I want to connect the Power BI with API having datasets of Marketing campaign and sales report having Parameter filter with challenges to get filter the data directly into the inteface-
Customer Name - Sean Abort
Region - Central
How is it possible ??
Because I know how to connect the BI with API(i.e through web option and pasted the link directly) .
Are there any other method to connect with API ??
Also please tell me data source for getting the dataset of API for practice on Marketing report or Sales report or how to connect the social media the dataset report( like facebook,instagram or many other platform)??
all
Thanks and regards,
Sudeep Kumar
Hi Sudip_KJ
To connect Power BI to APIs with filters, here’s a clear step-by-step guide to get you rolling:- Create new parameters (CustomerName = "Sean Abort" and Region = "Central")
- Dynamically insert the parameters in the API using Power Query:
let
Source = Json.Document(Web.Contents("https://api.example.com/data", [
Query = [
customer = CustomerName,
region = Region
]
]))
in
SourceOther methods:
- Use Power Automate to automate API calls and push data to Power BI via streaming datasets.
- Preprocess API data and send it to Power BI using Azure Functions or Logic Apps
Did it work? 👍 A kudos would be appreciated
🟨 Mark it as a solution to help spread knowledge 💡Hi Sudip_KJ,
Thanks for reaching out. Also, thanks to DataVitalizer, for his inputs on this thread. I understand you are looking to connect Power BI to an API and filter the data by parameters like Customer Name (Sean Abort) and Region (Central) and wondering if there are better ways to do this beyond just pasting the API URL into the Web connector.
You are on the right track using the Web connector. To filter the data directly using parameters, one effective approach is to create Power Query parameters in Power BI. These let you dynamically build your API URL so you can pass values like customer name or region directly into the request.
Here is a helpful guide from Microsoft that walks through how to do that:
Web.Contents - PowerQuery M | Microsoft Learn
Parameters - Power Query | Microsoft LearnOther API connection options: If you are wondering whether there are other ways to connect to APIs yes. Besides the Web connector, Power BI also supports:
- Using Power Query functions to loop through multiple parameter values
- Creating custom connectors, which are useful especially for APIs that require authentication (e.g., Facebook, Instagram)
Connecting to social media platforms (like Facebook or Instagram): These APIs often require OAuth (authentication via access tokens), so connecting them directly in Power BI usually involves a more advanced setup either through a custom connector or an external service like Azure Functions. You can explore that route here:
Connector extensibility in Power BI - Power BI | Microsoft Learn
Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.
Thank you for using the Microsoft Fabric Community Forum.
5 Replies
- DataVitalizer
Super User
Hi Sudip_KJ
To connect Power BI to APIs with filters, here’s a clear step-by-step guide to get you rolling:- Create new parameters (CustomerName = "Sean Abort" and Region = "Central")
- Dynamically insert the parameters in the API using Power Query:
let
Source = Json.Document(Web.Contents("https://api.example.com/data", [
Query = [
customer = CustomerName,
region = Region
]
]))
in
SourceOther methods:
- Use Power Automate to automate API calls and push data to Power BI via streaming datasets.
- Preprocess API data and send it to Power BI using Azure Functions or Logic Apps
Did it work? 👍 A kudos would be appreciated
🟨 Mark it as a solution to help spread knowledge 💡 - v-kpoloju-msft
Community Support
Hi Sudip_KJ,
Thanks for reaching out. Also, thanks to DataVitalizer, for his inputs on this thread. I understand you are looking to connect Power BI to an API and filter the data by parameters like Customer Name (Sean Abort) and Region (Central) and wondering if there are better ways to do this beyond just pasting the API URL into the Web connector.
You are on the right track using the Web connector. To filter the data directly using parameters, one effective approach is to create Power Query parameters in Power BI. These let you dynamically build your API URL so you can pass values like customer name or region directly into the request.
Here is a helpful guide from Microsoft that walks through how to do that:
Web.Contents - PowerQuery M | Microsoft Learn
Parameters - Power Query | Microsoft LearnOther API connection options: If you are wondering whether there are other ways to connect to APIs yes. Besides the Web connector, Power BI also supports:
- Using Power Query functions to loop through multiple parameter values
- Creating custom connectors, which are useful especially for APIs that require authentication (e.g., Facebook, Instagram)
Connecting to social media platforms (like Facebook or Instagram): These APIs often require OAuth (authentication via access tokens), so connecting them directly in Power BI usually involves a more advanced setup either through a custom connector or an external service like Azure Functions. You can explore that route here:
Connector extensibility in Power BI - Power BI | Microsoft Learn
Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.
Thank you for using the Microsoft Fabric Community Forum.- v-kpoloju-msft
Community Support
Hi Sudip_KJ,
Just checking in to see if the issue has been resolved on your end. If the earlier suggestions helped, that’s great to hear! And if you’re still facing challenges, feel free to share more details happy to assist further.Thank you.
- v-kpoloju-msft
Community Support
Hi Sudip_KJ,
Hope you had a chance to try out the solution shared earlier. Let us know if anything needs further clarification or if there's an update from your side always here to help.Thank you.