Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
So I have an unusual use case. I have created a dataset that goes out to each of the 32 NFL teams and downloads:
Their roster (5 tables)
Their injury report (1 table)
Their depth chart (1 table)
https://www.azcardinals.com/team/player-roster
https://www.atlantafalcons.com/team/player-roster
https://www.chicagobears.com/team/player-roster
(29 more similar URLs)
https://www.azcardinals.com/team/injury-report
https://www.atlantafalcons.com/team/injury-report
(30 more)
https://www.azcardinals.com/team/depth-chart
https://www.atlantafalcons.com/team/depth-chart
(30 more)
This way I can look at each team's website, who is on the active roster, who is listed under COVID-reserve, injured reserve, etc., if someone missed practice I can relate that to the depth chart and see if the starter is injured. It's very neat. This is a simplified query with just three teams (but yields the same problem) so you can follow along if you'd like:
let
TeamList = {
"azcardinals", "atlantafalcons", "chicagobears"
},
Get_DepthChart = (teamName as text) =>
/* extracts table from: www.foo.com/team/depth-chart */
let
Source = Web.BrowserContents("https://www." & teamName & ".com/team/depth-chart"),
#"Extracted Table From Html" = Html.Table(Source, {{"Column1", "DIV[id='scroll-offense'] > DIV.d3-o-table--horizontal-scroll > TABLE.d3-o-table.d3-o-table--row-striping.d3-o-table--detailed.d3-o-depthchart > * > TR > :nth-child(1)"}, {"Column2", "DIV[id='scroll-offense'] > DIV.d3-o-table--horizontal-scroll > TABLE.d3-o-table.d3-o-table--row-striping.d3-o-table--detailed.d3-o-depthchart > * > TR > :nth-child(2)"}, {"Column3", "DIV[id='scroll-offense'] > DIV.d3-o-table--horizontal-scroll > TABLE.d3-o-table.d3-o-table--row-striping.d3-o-table--detailed.d3-o-depthchart > * > TR > :nth-child(3)"}, {"Column4", "DIV[id='scroll-offense'] > DIV.d3-o-table--horizontal-scroll > TABLE.d3-o-table.d3-o-table--row-striping.d3-o-table--detailed.d3-o-depthchart > * > TR > :nth-child(4)"}, {"Column5", "DIV[id='scroll-offense'] > DIV.d3-o-table--horizontal-scroll > TABLE.d3-o-table.d3-o-table--row-striping.d3-o-table--detailed.d3-o-depthchart > * > TR > :nth-child(5)"}}, [RowSelector="DIV[id='scroll-offense'] > DIV.d3-o-table--horizontal-scroll > TABLE.d3-o-table.d3-o-table--row-striping.d3-o-table--detailed.d3-o-depthchart > * > TR"]),
#"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}})
in
#"Changed Type",
List_DepthChartTables = List.Transform(
TeamList,
each Get_DepthChart(_)
),
#"Converted to Table" = Table.FromList(List_DepthChartTables, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandTableColumn(#"Converted to Table", "Column1", {"Column1", "Column2", "Column3", "Column4", "Column5"}, {"Column1.Column1", "Column1.Column2", "Column1.Column3", "Column1.Column4", "Column1.Column5"})
in
#"Expanded Column1"
However, when I try to set up a scheduled refresh in the Power BI Service, I get the following error:
"This dataset includes a dynamic data source. Since dynamic data sources aren't refreshed in the Power BI service, this dataset won't be refreshed. Learn more: https://aka.ms/dynamic-data-sources."
Okay, so let's wander over to the URL and see what it says (emphasis mine):
Indeed, doing some Googling Binging shows that the RelativePath and Query options are a workaround to this error.
As Chris Webb writes (emphasis once again mine):
However, each of these solutions are with the same base url. www.domain.com/q=24601, www.domain.com/q=31415 etc.
Here it's www.domain1.com/blah www.domain2.com/blah, which doesn't work with RelativePath in Web.Contents().
Excerpted from the WebContents() documentation:
So my RelativePath savior doesn't work because it only appends to the end of the base URL. Phooey.
Loading each table individually is not practical, as there are 224 of them!
I'm completely stuck and don't know where to go from here. Is this a Power Automate situation? (I've never used Power Automate before, but I can go with the flow if that's my only good option, but I would really like to stay in Power BI if I can.)
Update: I tried setting up a Power Automate Flow for this, but it doesn't seem to work. Everything says it's successful, but then nothing updates.
What are my options for setting up a scheduled refresh? I could try to learn the REST API to set up a scheduled refresh, although this gives me pause:
https://azure.microsoft.com/en-us/updates/power-bi-embedded-analytics-rest-api-schedule-refresh/
"Note that this API is relevant for cached (import mode) or composite models only."
I don't know what that means, but I'm getting increasingly frustrated with each new approach to this problem and failing. I just want to do a scheduled refresh with a variable in the base URL. You'd think this would be easier, buuuut
Any help would be much appreciated. Thank you!
Hi, @zbeg
Sorry for that can't fix it on my side currently.
If you are a pro user ,please kindly raise it to the MS Support Team for better advice, thanks a lot!
https://powerbi.microsoft.com/en-us/support/
Best Regards,
Community Support Team _ Eason
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.