I am currently working on a Power BI Desktop project where I need to dynamically update a parameter value based on data from a client’s website. The goal is to have this parameter value automatically refresh without manual intervention to reflect changes from the client’s webpage.
Here is the scenario:
- I have a base URL parameter in my Power BI report.
- This base URL needs to be dynamically updated based on a value retrieved from the client’s website.
- The client’s website is built using React.js.
- I need this update to occur seamlessly within Power BI Desktop and eventually extend this functionality to scheduled refreshes when published to Power BI Service.
I have tried setting up a parameter in Power BI Desktop and manually updating it, but I need a solution that automates this process.
I appreciate any guidance or solutions you can provide to help achieve this dynamic parameter update within Power BI Desktop.
Thank you.
Steps Taken:
1 ) Fetch Data from Client’s API:
let
BaseURL = “https://api.example.com”,
body = “{“”sessionId””: “”efac9d4b-7bd9-4efc-80fd-cb623b076da4″”, “”isSearch””: false, “”keyword””: “”””, “”exploreType””: 2}”,
Source = Json.Document(Web.Contents(BaseURL, [
RelativePath = “/testAPI/explorer/location_hierarchy”,
Content = Text.ToBinary(body),
Headers = [#”Content-Type” = “application/json”]
])),
#”Converted to Table” = Record.ToTable(Source),
Value = #”Converted to Table”{1}[Value],
#”Converted to Table1″ = Record.ToTable(Value),
Value1 = #”Converted to Table1″{0}[Value],
#”Parsed JSON” = Json.Document(Value1),
#”Converted to Table2″ = Record.ToTable(#”Parsed JSON”),
#”Expanded Value” = Table.ExpandListColumn(#”Converted to Table2″, “Value”),
#”Expanded Value1″ = Table.ExpandRecordColumn(#”Expanded Value”, “Value”, {“EntID”, “EntityName”, “Name”, “Description”, “Type”, “Icon”, “Room”}, {“EntID”, “EntityName”, “Name.1”, “Description”, “Type”, “Icon”, “Room”})
in
#”Expanded Value1″
-
Create Specific Reports:
-
Create Parameter in Power BI Report:
Set up a parameter in the Power BI report to dynamically change the base URL or any other required parameters based on the fetched data.
Used Power Query parameters and updated them as needed to ensure the data fetch logic uses the latest values. -
Publish Report to Power BI Service:
Viral Gajjar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.