Reputation: 488
I have a Power Query table that is pulling in Data from an ODBC connection, filtering that data and then returning it into excel. I then have several columns added to the table in excel that are utilizing the Excel networkdays formula. My issue is that occasionally the Power Query table will be empty and when empty the NetWorkdays formulas disappear from the excel table.
My question is this. Is there a way to either check if Power Query is empty and return 0's or something else that will prevent the formula's in the excel cells from disappearing, or a way to prevent excel from removing the formula's if the table is empty?
Upvotes: 2
Views: 9007
Reputation: 874
You can edit the query and use the "if" function, e.g.
let
#"Some Result" = if not List.IsEmpty(#"Some List") then
#"Some List"
else
{"define","some","default","list","here"}
in
#"Some Result"
Upvotes: 1
Reputation: 57
I found a way to make it so that Power Query will return a blank row if there is no data in the query result, but it is a bit of a workaround.
In the end, if there is no data returned from the ODBC query, it will load the row from the table you created in Step 1. If there is data in the ODBC query, the row from the Step 1 table will get filtered out by the Left Anti Join.
Upvotes: 1