How can I sort X-Axis and Legend Entries?

Viewed 486

I have a dashboard where I am measuring a metric value for different items during the day and then displaying it on Google Data Studio.

On the X-axis, I am displaying time of day in hhmm format (internally this is a number) and on the Y-axis I have the metric value with different lines for different items.

I want to display X-Axis in chronological order and the legend entries for different items in descending order of cumulative metric value. This should be more clear from the image here:

1

There is a sort option available in Google Data Studio but its not very clear on demarcation between X-Axis and the legend.

1 Answers

Display the time is chronological order by setting the X-axis Sort in the line chart to:

  • Field: TIME
  • Order: Ascending

To sort the ITEM values in legend by cumulative METRIC, change the Secondary Sort to:

  • Field: Metric
  • Aggregation: SUM
  • Order: Descending

Additionally, to ensure that all 11 items are displayed change the Number of Series (in the Style Tab) from the default, 10, to the required number, with 20, currently being the maximum number of unique series (lines) that can be displayed simultaneously.

Editable Google Data Studio Report (Embedded Google Sheets Data Source) and a GIF to elaborate:

enter image description here

Related