How to Change Order of Columns in Power BI


Often you may want to change the order of columns in two different scenarios in Power BI:

Scenario 1: Change Order of Columns in Table View

Scenario 2: Change Order of Columns in a Table in Report View

The following examples show how to change the order of columns in both scenarios.

Example 1: Change Order of Columns in Table View

Suppose we have the following table in Power BI named my_data that contains information about various basketball players:

Suppose that we would like to change the columns to be in the following order:

  • Team
  • Rebounds
  • Assists
  • Points

The easiest way to do this is by using the SELECTCOLUMNS function in DAX to create a new table in which the columns are in the exact order that you specify.

To do so, click the Table tools tab and then click the New table icon:

Then type the following formula into the formula bar:

New Table = 
SELECTCOLUMNS (
    my_data,
    "Team", my_data[Team],
    "Rebounds", my_data[Rebounds],
    "Assists", my_data[Assists],
    "Points", my_data[Points]
)

This will create a new table named New Table in which the columns are in the exact order that we specified:

Power BI change order of columns

Note: You can find the complete documentation for the SELECTCOLUMNS function in DAX here.

Example 2: Change Order of Columns in a Table in Report View

Suppose we insert the following table in Report View that summarizes the points, assists and rebounds for each unique team:

Suppose that we would like to change the columns in the table to be in the following order:

  • Team
  • Sum of Rebounds
  • Sum of Assists
  • Sum of Points

The easiest way to do so is by clicking and dragging the column names up or down within the Columns pane of the Visualizations tab to the exact order that you’d like:

Power BI change column order in table in Report View

Notice that the columns in the table are now in the exact order that we specified.

Additional Resources

The following tutorials explain how to perform other common tasks in Power BI:

How to Change Legend Order in Power BI
How to Add Index Column to Table in Power BI
How to Change Column Width in Table in Power BI

Leave a Reply

Your email address will not be published. Required fields are marked *