Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
This seems to be something others have struggled with and I've tried a few different ways, but when I attempt to create a function, and pass it as a parameter used in getting a specific web resource I receive the message. "One or more entities references a dynamic data source." This happens when I try to save the dataflow, even with "Enable Load" unchecked and only having declared the function, not actually using it yet.
The query "compiles"? fine in the editor, but I'm unable to save the dataflow if this query is included. Is this a license limitation?, I have PowerBI pro.
Calling out the area where I'm having issues.
let
Query = (ReportID as text) => let
/// Get a Auth Token to connect with
LoginAuthURL = "https://fqdn/ta/rest/v1/login",
PostBody = [
credentials = [
company = "xxxx",
username = "xxx",
password = "xxxxx"
]
],
Header = [#"Content-type"="application/json",
#"Api-Key" = "dt8udy2jzhyzn6v4qpd16ykpz6ukc698"
],
out = Json.Document( Web.Contents(LoginAuthURL, [Content=Json.FromValue(PostBody),Headers=Header])),
#"Converted to Table" = Record.ToTable(out),
#"Filtered Rows" = Table.SelectRows(#"Converted to Table", each ([Name] = "token")),
Token = #"Filtered Rows"{0}[Value],
/// Pull Report from System
/// ReportURL1
ReportURL1 = "https://fqdn/ta/rest/v1/report/saved/123456",
/// ReportURL2
ReportURL2 = "https://fqdn/ta/rest/v1/report/saved/654321",
/// workaround for not being able to declare the ReportID as a parameter
ReportURL = if ReportID = 1 then
ReportURL1
else ReportURL2,
ReportHeader = [
#"Content-type"="application/json",
#"Api-Key" = "jakldjafkljsdklfajsdkljklasdjklas",
#"Authentication" = "Bearer " & Token
],
///// These won't "save"
///ReportResult = Web.Contents("https://fqdn/ta/rest/v1/report/saved/" & ReportID,[Headers=ReportHeader]),
///ReportResult = Web.Contents(ReportURL,[Headers=ReportHeader]),
///// This "will save"
ReportResult = Web.Contents(ReportURL1,[Headers=ReportHeader]),
ReportOutput = Csv.Document(ReportResult),
#"Promoted Headers" = Table.PromoteHeaders(ReportOutput, [PromoteAllScalars=true])
in
#"Promoted Headers"
in
Query
Solved! Go to Solution.
After some more digging, I think I found something that works. Using, RelativePath the function attribute.
I updated the query to have ReportQueryURL be the full path up to the "ID" value I needed to parameterize.
ReportResult = Web.Contents(ReportQueryURL,
[RelativePath=ReportID,
Headers=ReportHeader]),
ReportOutput = Csv.Document(ReportResult),
I'm able to save the dataflow, with the function, and my first 'test' of the function is working as well.
After some more digging, I think I found something that works. Using, RelativePath the function attribute.
I updated the query to have ReportQueryURL be the full path up to the "ID" value I needed to parameterize.
ReportResult = Web.Contents(ReportQueryURL,
[RelativePath=ReportID,
Headers=ReportHeader]),
ReportOutput = Csv.Document(ReportResult),
I'm able to save the dataflow, with the function, and my first 'test' of the function is working as well.
Hi @jnickell ,
So has the issue been solved now?
Yes my issue seems to be resolved now.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
39 | |
37 | |
32 | |
25 | |
24 |
User | Count |
---|---|
37 | |
29 | |
23 | |
21 | |
17 |