Search code examples
powerbivisualizationpowerbi-desktop

How to sort a line chart X-axis by a different column than displayed


I'm using PowerBI Desktop, version 2.139.1678.0 64-bit (January 2025)

I have a line chart using numeric data (sum) on the y-axis, and string data on the x-axis (sample_name.)

I would like to sort the x-axis by the date the batch was created. I have a separate data column correlating 1-to-1 with the batch name column (sample_name.) I have sorted the sample_name column in the data view by the date column, which correctly sorts the sample_name column in data view, but doesn't change the sorting on the chart.

Is it possible to sort the chart's x-axis by a column other than the column from which the data is derived?

enter image description here

enter image description here


Solution

  • You need to set a sort column in the data model: https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column