Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
magnifybi
Resolver I
Resolver I

Dynamic Web.Contents Power BI Refresh Error

Hey guys,

 

I've been racking my brains for the last week or so trying to get my query converted so I can run a scheduled refresh with my dynamic Web.Contents query.

 

I have read the following solution and understand the logic behing the concept but am really struggling to apply it to my query;

 

https://community.powerbi.com/t5/Service/Dynamic-Web-Contents-Power-BI-Refresh-Error/td-p/714526

 

I have also read all of the associated learning materials and likewise, I get the approach but can't apply it to my use case;

 

Web.Contents(), M Functions And Dataset Refresh Errors In Power BI

Dynamic Web.Contents() and Power BI Refresh Errors

Using The “Skip Test Connection” Option For Power BI Data Sources To Avoid Scheduled Refresh Failure...

 

I would be so grateful if someone could help me figure out how I need to change my below query so I can use this on scheduled refreshes.

 

I have a table of date ranges that I use this query for via an invoked function and it is working away fine, only issue is converting it.

 

Apologies if the formatting of the quotes here are wrong, I couldn't figure out how to quote M Query.

 

(DateRange)=>

let
    Source = Web.Contents("https://api.weworked.com/v1/reports/summary?fromdate="&DateRange&"&projects=all&showzeros=0&taskstatus=all&timestatus=all&users=all", [Headers=[#"x-api-key"="xxxxxxxxxxxxxxxxxx", #"x-ww-user"="xxx@xxx.co.uk"]]),
    #"JSON" = Json.Document(Source),
    #"Converted to Table" = Table.FromList(JSON, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"FirstName", "LastName", "UserId", "InternalId", "Rows"}, {"Column1.FirstName", "Column1.LastName", "Column1.UserId", "Column1.InternalId", "Column1.Rows"}),
    #"Expanded Column1.Rows" = Table.ExpandListColumn(#"Expanded Column1", "Column1.Rows"),
    #"Expanded Column1.Rows1" = Table.ExpandRecordColumn(#"Expanded Column1.Rows", "Column1.Rows", {"project", "task", "taskCode", "billable", "invoiceMethodId", "invoiceMethodName", "rate", "hours", "total"}, {"Column1.Rows.project", "Column1.Rows.task", "Column1.Rows.taskCode", "Column1.Rows.billable", "Column1.Rows.invoiceMethodId", "Column1.Rows.invoiceMethodName", "Column1.Rows.rate", "Column1.Rows.hours", "Column1.Rows.total"})
in
    #"Expanded Column1.Rows1"

 

Thanks,

 

Jon 

2 REPLIES 2
magnifybi
Resolver I
Resolver I

This is what I have tried but there is some issue with the Query part, would really love some help.

 

(DateRange)=>

let
    Source = Web.Contents("https://api.weworked.com/v1/reports", [Query=[summary?fromdate="&DateRange&"&projects=all&showzeros=0&taskstatus=all&timestatus=all&users=all], Headers=[#"x-api-key"="xxxxxxxxxxxxxxxxxx", #"x-ww-user"="xxx@xxx.co.uk"]]),
    #"JSON" = Json.Document(Source),
    #"Converted to Table" = Table.FromList(JSON, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"FirstName", "LastName", "UserId", "InternalId", "Rows"}, {"Column1.FirstName", "Column1.LastName", "Column1.UserId", "Column1.InternalId", "Column1.Rows"}),
    #"Expanded Column1.Rows" = Table.ExpandListColumn(#"Expanded Column1", "Column1.Rows"),
    #"Expanded Column1.Rows1" = Table.ExpandRecordColumn(#"Expanded Column1.Rows", "Column1.Rows", {"project", "task", "taskCode", "billable", "invoiceMethodId", "invoiceMethodName", "rate", "hours", "total"}, {"Column1.Rows.project", "Column1.Rows.task", "Column1.Rows.taskCode", "Column1.Rows.billable", "Column1.Rows.invoiceMethodId", "Column1.Rows.invoiceMethodName", "Column1.Rows.rate", "Column1.Rows.hours", "Column1.Rows.total"})
in
    #"Expanded Column1.Rows1"

 

Hi @magnifybi ,

 

What issue have you got?Do you have some notifications such as below:

v-kelly-msft_0-1619078769415.png

 

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors