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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
G-Salyer-13
New Member

How to ignore "Web query returned no data" error

I have the following querry but it sometimes gives the error "This Web query returned no data". I need to stop this error from being shown and if no data is returned, just leave the tables filled with the results of the last succesful querry. I produced this code using the Data - From Web button. 

 

let
Source = Web.Page(Web.Contents("https://tradingeconomics.com/commodities")),
Data1 = Source{1}[Data],
#"Changed Type" = Table.TransformColumnTypes(Data1,{{"Metals", type text}, {"Price", type number}, {"Day", type number}, {"%", Percentage.Type}, {"Weekly", Percentage.Type}, {"Monthly", Percentage.Type}, {"YoY", Percentage.Type}, {"Date", type date}})
in
#"Changed Type"

2 REPLIES 2
Anonymous
Not applicable

Hi @G-Salyer-13 

You can use try.. otherwise function, you can refer to the following link.
Solved: Ignore Data source if fails to load - Microsoft Fabric Community

Solved: Append all queries that have no error - Microsoft Fabric Community

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I have no clue how to implement this into the code I posted. This is the code created by the Data - From Web button....

 

let
Source = Web.Page(Web.Contents("https://tradingeconomics.com/commodities")),
Data1 = Source{1}[Data],
#"Changed Type" = Table.TransformColumnTypes(Data1,{{"Metals", type text}, {"Price", type number}, {"Day", type number}, {"%", Percentage.Type}, {"Weekly", Percentage.Type}, {"Monthly", Percentage.Type}, {"YoY", Percentage.Type}, {"Date", type date}})
in
#"Changed Type"

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.