Forum Discussion
FredLEGUEN
Helper III
4 years agoIf test is true, then run a specific query
Hi group,
I have written a Power Query project to merge different files from different folders.
I'm facing an issue if one of the folders is empty.
For each folder, I have done 2 queries
- The first query connect to the folder
- The second execute the steps for the files
I would like to do a test before the second query like this
not(Table.IsEmpty(previousquery))
The test works but I just don't know how to write my query if the test returns true or false
Any idea?
Hi,
Finally, I have found the way to write my condition and the 2 branches
let Source = if not(Table.IsEmpty(Query2)) then Table.Combine({Query1, Query2}) else Query1,
2 Replies
- AnonymousNot applicable
= if not(Table.IsEmpty(previousquery)) then QueryName else OtherQueryName
--Nate
- FredLEGUEN
Helper III
Hi,
Finally, I have found the way to write my condition and the 2 branches
let Source = if not(Table.IsEmpty(Query2)) then Table.Combine({Query1, Query2}) else Query1,