Forum Discussion
Anonymous
5 years agoNot applicable
How to write a code in Power Query that fills an empty query/table with a zero in a specific column?
Hi all, Is it possible to write a code that checks if the query in Power Query is empty or not and then fills in the 'Days taken to complete' as 0 if it is? For example, in the query below, there...
Anonymous
5 years agoNot applicable
Here are the list of the Queries, I am trying to use this code for Quick WIn Average Time Taken, which originally gets all the information from Main Programme CI log, and then I've added manipulated this data to create this query. I am looking to insert it after step FilteredRows1 as two steps after (Avergae) is where the error loads from:
Here are all the table names in order:
PhilipTreacy
5 years agoSuper User
Hi Anonymous
OK the single line you need to insert into your code is
#"Added Custom1" = if Table.IsEmpty(#"Filtered Rows1") then Table.InsertRows(#"Filtered Rows1", 0, {[Initiative Status = null, Target Date = null, Date Raised = null, Scale = null, Date Completed = null, Date Started = null, Project Controls = null, Days taken to complete = 0, Average = null]}) else null
You need to open the Advanced Editor and replace the #"Added Custom1" step shown in your screenshot above.
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.