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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Query Editor Error when query is empty

Hi, I have a query in the query editor that brings me the errors detected in other query:

error.jpg

 

This appears in a table and is useful for the users to detect the errors and fix them.

 

But when there is no error, the query fails and I can't get the report refreshed. 

 

Is there a possibility to , if the query is empty, allow the report to refresh without problems? And the table that shows the error would be empty. Maybe there is an M code that allows this.

 

Thanks

4 REPLIES 4
Anonymous
Not applicable

@Anonymous 

Check if there are errors in the original queries. Can you share the error message? Is it possible to produce that error and share the pbix with us.


Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , Did not get it completely. But there should be an error in some row.

refer if this can help

https://www.youtube.com/watch?v=OE6DPmKqN7s

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
mahoneypat
Microsoft Employee
Microsoft Employee

Yes.  You can use try ... otherwise in your last step (or in the "in" expression).  You can have the otherwise part return null or you can point to another query with mock/empty data (if you need columns to match your actual data if you have a visual expecting values, etc.).  Please see this link for more about try ... otherwise - https://docs.microsoft.com/en-us/power-query/handlingerrors

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Thanks, can you provide an example of a line in M with try / otherwise?

I would like to use it in the step "Replace Errors". If there is no error, then put replace the content of the columns with blanks

 

 

Regards,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.