Moony
Moony

Reputation: 3

Can I implement a step in PowerQuery based on a condition?

I wanted to know if it is possible to let a step in the PowerQuery Editor be conducted based on a condition?

Basically, what I'm doing is that I am merging three specific tables in PowerQuery. Now, in Excel I have an additional field to check whether an optional fourth table should also be merged or not. Therefore, in PowerQuery I would need the condition to only do the merging of the fourth table in case the field in Excel was checked. Is something like this possible?

Thanks in advance!

Upvotes: 0

Views: 1043

Answers (1)

Peter
Peter

Reputation: 12295

You would have to manually edit it in the advanced editor:

#"Previous Steps"
#"Merged Queries" = if <condition> then Table.NestedJoin(#"Previous Steps", ...) else #"Previous Steps"),

Upvotes: 2

Related Questions