Changing x-axis group and sort with parameter

I have an example below of 2 bar charts. One is grouped by a fiscal year (string field) and the other is grouped by a fiscal quarter (calculated string field).

The first chart is sorted by Fiscal Year along the x axis. This sorts correctly as a string and puts the “dates” in order.

The second chart wouldn’t work to sort by the fiscal quarter string field. So I am choosing to sort by a different field to get this to be in the correct order.

For these types of charts, the desire would be to have one chart and have a parameter control where the user can choose if they want to see the data by year, quarter, month, etc.

I know how to create this parameter control, create a calculated field that checks it and returns either my FiscalYear field or my FiscalQuarterWithYear field, and then I put that calculated field into my X-axis group.

My question is, how do I also control/change the sort in this scenario?

1 Like

@CoreyLeichty , for Fiscal Quarter, could we do YYYY Q#, for example, 2022 Q1, 2021 Q4 and so on. And then, your sort should be correct based on the Fiscal Quarter column.