Skip to content Skip to sidebar Skip to footer

Power Bi Clustered Column Chart Sort X Axis

Power BI is a powerful data visualization tool that enables you to create interactive and compelling reports and dashboards. One of the most commonly used chart types in Power BI is the clustered column chart, which is used to compare values across categories. However, sometimes the categories on the x-axis may not be sorted in the desired order. In this article, we will explore how to sort the x-axis of a clustered column chart in Power BI.

What is a Clustered Column Chart?

A clustered column chart is a type of chart that displays data as vertical bars that are clustered together. Each cluster represents a category, and each bar within the cluster represents a value. This chart is useful for comparing values across categories and can be customized to display additional information such as data labels or a legend.

Clustered Column Chart

Sorting the X-Axis of a Clustered Column Chart

When creating a clustered column chart in Power BI, the categories on the x-axis are automatically sorted in alphabetical order. However, this may not be the desired order, especially when dealing with time-series data or when the categories have a logical order.

To sort the x-axis of a clustered column chart in Power BI, follow these steps:

  1. Select the clustered column chart you want to modify.
  2. Click on the x-axis of the chart to select it.
  3. Click on the "Modeling" tab in the ribbon at the top of the screen.
  4. Click on the "Sort by Column" button in the "Sort By" section.
  5. Select the column you want to sort the x-axis by.
  6. Choose the desired sort order (ascending or descending).

After following these steps, the categories on the x-axis of the clustered column chart will be sorted according to the selected column and sort order.

Using a Custom Sort Order

If the desired sort order is not available in the source data, it is possible to create a custom sort order in Power BI. To do this, follow these steps:

  1. Create a new table that contains the categories and their desired sort order.
  2. Ensure that the sort order column is of type "Whole Number".
  3. Create a relationship between the new table and the table that contains the data for the clustered column chart.
  4. Select the clustered column chart you want to modify.
  5. Click on the x-axis of the chart to select it.
  6. Click on the "Modeling" tab in the ribbon at the top of the screen.
  7. Click on the "Sort by Column" button in the "Sort By" section.
  8. Select the sort order column from the new table.
  9. Choose the desired sort order (ascending or descending).

After following these steps, the categories on the x-axis of the clustered column chart will be sorted according to the custom sort order defined in the new table.

Conclusion

Sorting the x-axis of a clustered column chart in Power BI is a simple process that can greatly enhance the readability and usefulness of your reports and dashboards. By following the steps outlined in this article, you can easily sort the x-axis by a column in the source data or create a custom sort order to suit your needs.

Related video of Power BI Clustered Column Chart Sort X Axis