Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

m_dekorte

To Delete or Keep Columns? That's the Question.

In Power Query, there are two functions to manage columns in a table, which are accessible through three different actions in the User Interface. Located on the Home tab, these actions allow you to perform the following operations:
👉 Choose Columns (which calls: Table.SelectColumns)
👉 Remove Columns (calls: Table.RemoveColumns) and
👉 Remove Other Columns (calls: Table.SelectColumns)

Choosing the right method depends on your specific needs. Let’s explore this with a practical scenario. Imagine you have an "Items" table from a small database. Most of your transformations are handled within a Dataflow using Power Query Online to prepare that table for easy use within various semantic models.

In Dataflows, you can opt for removing columns. This allows new columns "added" or made available at the source, to appear without needing to update the Dataflow manually, ensuring flexibility and reducing maintenance.

In semantic Models, you can opt for selecting columns early by choosing only necessary columns from the Dataflow "Items" table for that specific semantic model in development. This locks or limits columns, preventing unneeded columns from bloating the model.


To enhance reliability, make sure to pass an argument for the optional MissingField parameter, this enables you to specify how absent fields should be handled. For example:

  • In Dataflows, use MissingField.Ignore to avoid errors when removing non-existent columns.
  • In Models, use MissingField.UseNull to maintain a table's structure and allow investigation or reporting of completely empty columns.

 

Choosing the right method ensures your queries are more robust and reliable, while your models stay lean and manageable.

 

Learn more about the MissingField.Type

Comments