Skip to main content
Microsoft Idea

Power BI

Needs Votes

Query error handling if exists

Vote (1) Share
Daniel Bartley's profile image

Daniel Bartley on 18 Aug 2017 10:20:15

I have a fleet of files connected to sql databases.
If we had redundant columns in the source we sometimes removed them using the power query "remove columns" feature.

The gotcha is that if you later remove the columns from the source system, the query breaks because it cant find the columns to remove them.

Syntax similar to the 'DROP column IF EXISTS' would be more resilient and easy to understand.

Comments (1)
Daniel Bartley's profile image Profile Picture

Martin on 05 Jul 2020 23:03:41

RE: Query error handling if exists

select the columns you want to keep, then use the 'remove other columns' button.