Forum Discussion
Want to connect Power BI with API with using Parameter to filter the Dataset
- 1 year ago
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 💡 - 1 year ago
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.
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.
Hi Sudip_KJ,
Just wanted to follow up one last time. If the shared guidance worked for you, that’s wonderful hopefully it also helps others looking for similar answers. If there’s anything else you'd like to explore or clarify, don’t hesitate to reach out.
Thank you.