You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "srijani-smsrc (via GitHub)" <gi...@apache.org> on 2026/04/13 05:54:31 UTC
[D] FILTER SORT ORDER [superset]
GitHub user srijani-smsrc created a discussion: FILTER SORT ORDER
FILTER SORT ORDER — Quarters appearing alphabetically
This is a known Superset issue but has workarounds. Create a calculated sort column in the underlying dataset (e.g., a numeric quarter_order field) and use the Sort Metric configuration in the filter to sort by that column while displaying the quarter label. This is a data modelling fix, not a platform limitation.
i need to sort the month not in alphabetical order but in chronologically order ... in superset 5.
@dosubot
GitHub link: https://github.com/apache/superset/discussions/39308
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] FILTER SORT ORDER [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: FILTER SORT ORDER
<!-- Answer -->
You're on the right track with the approach you described! Superset's native filters have a built-in **Sort Metric** feature that handles exactly this. Here's how to get months sorted chronologically:
1. **Add a numeric sort column to your dataset** — Create a calculated column (e.g., `month_order`) that maps each month to its numeric value (January → 1, February → 2, … December → 12). You can do this in your database view/query or as a calculated column in the Superset dataset. For example in SQL: `EXTRACT(MONTH FROM your_date_column) AS month_order`.
2. **Configure the filter's sort settings** — In your dashboard's native filter configuration panel, expand the **"Sort filter values"** section [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1082). There you'll find:
- **Sort type** — Set to ascending [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1107-L1111)
- **Sort Metric** — Select your `month_order` column here [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1134)
This tells Superset to display the month name in the filter dropdown but sort the values using the numeric `month_order` column instead of alphabetically [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/filters/components/Select/types.ts#L44).
The same approach works for quarters or any other values you need in a custom order. This works in Superset 5 — it's part of the native filter configuration UI, no code changes needed.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response#message_id=de045022-c315-4469-8a06-f43b75fcea28&feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer#message_id=de045022-c315-4469-8a06-f43b75fcea28&feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources#message_id=de045022-c315-4469-8a06-f43b75fcea28&feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose#message_id=de045022-c315-4469-8a06-f43b75fcea28&feedback_type=too_verbose) | [Hallucination](https://app
.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination#message_id=de045022-c315-4469-8a06-f43b75fcea28&feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report#message_id=de045022-c315-4469-8a06-f43b75fcea28&feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other#message_id=de045022-c315-4469-8a06-f43b75fcea28&feedback_type=other)</sup>
[](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge) [](https://cursor.com/link/prompt?text=You%27re%20on%20the%20right%20track%20with%20the%20approach%20you%20described%21%20Superset%27s%20native%20filters%20have%20a%20built-in%20%2A%2ASort%20Metric%2A%2A%20feature%20that%20handles%20exactly%20this.%20Here%27s%20how%20to%20get%20months%20sorted%20chronologically%3A%0A%0A1.%20%2A%2AAdd%20a%20numeric%20sort%20column%20to%20your%20dataset%2A%2A%20%E2%80%94%20Create%20a%20calculated%20column%20%28e.g.%2C%20%60month_order%60%29%20that%20maps%20each%20month%20to%20its%20numeric%20value%20%28January%20%E2%86%92%201%2C%20February%20%E2%86%92%202%2C%20%E2%80%A6%20December%20%E2%86%92%2012%29.%20You%20can%20do%20this%20in%20your%20database%20view/query%20or%20as%20a%20calcula
ted%20column%20in%20the%20Superset%20dataset.%20For%20example%20in%20SQL%3A%20%60EXTRACT%28MONTH%20FROM%20your_date_column%29%20AS%20month_order%60.%0A%0A2.%20%2A%2AConfigure%20the%20filter%27s%20sort%20settings%2A%2A%20%E2%80%94%20In%20your%20dashboard%27s%20native%20filter%20configuration%20panel%2C%20expand%20the%20%2A%2A%22Sort%20filter%20values%22%2A%2A%20section%20%5B%5B1%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1082%29.%20There%20you%27ll%20find%3A%0A%0A%20%20%20-%20%2A%2ASort%20type%2A%2A%20%E2%80%94%20Set%20to%20ascending%20%5B%5B2%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1107-L1111%29%0A%20%20%20-%20%2A%2ASort%20Metric%2A%2A%20%E2%80%94%20Se
lect%20your%20%60month_order%60%20column%20here%20%5B%5B3%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1134%29%0A%0AThis%20tells%20Superset%20to%20display%20the%20month%20name%20in%20the%20filter%20dropdown%20but%20sort%20the%20values%20using%20the%20numeric%20%60month_order%60%20column%20instead%20of%20alphabetically%20%5B%5B4%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/filters/components/Select/types.ts%23L44%29.%0A%0AThe%20same%20approach%20works%20for%20quarters%20or%20any%20other%20values%20you%20need%20in%20a%20custom%20order.%20This%20works%20in%20Superset%205%20%E2%80%94%20it%27s%20part%20of%20the%20native%20filter%20configuration%20UI%2C%20no%20code%20changes%20needed.) [](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/39308)
GitHub link: https://github.com/apache/superset/discussions/39308#discussioncomment-16539760
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] FILTER SORT ORDER [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: FILTER SORT ORDER
<!-- Answer -->
Here's how to set it up directly in the dashboard filter UI:
**Step 1 — Add a calculated column to your dataset**
1. Go to **Datasets**, find your dataset, and click **Edit**.
2. Go to the **Calculated Columns** tab [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/components/Datasource/DatasourceEditor.jsx#L1742-L1780).
3. Click **"+ Add item"** and create a column called `month_order` with a SQL expression like:
```sql
EXTRACT(MONTH FROM your_date_column)
```
Or if your months are text labels:
```sql
CASE
WHEN month_name = 'January' THEN 1
WHEN month_name = 'February' THEN 2
WHEN month_name = 'March' THEN 3
WHEN month_name = 'April' THEN 4
WHEN month_name = 'May' THEN 5
WHEN month_name = 'June' THEN 6
WHEN month_name = 'July' THEN 7
WHEN month_name = 'August' THEN 8
WHEN month_name = 'September' THEN 9
WHEN month_name = 'October' THEN 10
WHEN month_name = 'November' THEN 11
WHEN month_name = 'December' THEN 12
END
```
4. Save the dataset. Then create a **metric** on this column (e.g., `MIN(month_order)`) in the **Metrics** tab — this is needed because the Sort Metric dropdown works with metrics, not raw columns [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1120-L1174).
**Step 2 — Configure the dashboard filter**
1. Open your dashboard in **edit mode**.
2. Click the **gear icon** on the filter bar and select **"Add or edit filters"** [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx#L165-L176).
3. Select your month filter (or create a new one).
4. Scroll down to the **"Sort filter values"** section and expand it [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1080-L1082).
5. Set **Sort type** to "Sort ascending" [[5]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1088-L1119).
6. In the **Sort Metric** dropdown, select the metric you created (e.g., `MIN(month_order)`) [[6]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1137-L1142).
7. Save the filter configuration.
Your month filter should now display months in chronological order (January → December) instead of alphabetical.
Let me know what database you're using if you need help with the exact SQL syntax for the calculated column!
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response#message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5&feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer#message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5&feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources#message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5&feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose#message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5&feedback_type=too_verbose) | [Hallucination](https://app
.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination#message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5&feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report#message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5&feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other#message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5&feedback_type=other)</sup>
[](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge) [](https://cursor.com/link/prompt?text=Here%27s%20how%20to%20set%20it%20up%20directly%20in%20the%20dashboard%20filter%20UI%3A%0A%0A%2A%2AStep%201%20%E2%80%94%20Add%20a%20calculated%20column%20to%20your%20dataset%2A%2A%0A%0A1.%20Go%20to%20%2A%2ADatasets%2A%2A%2C%20find%20your%20dataset%2C%20and%20click%20%2A%2AEdit%2A%2A.%0A%0A2.%20Go%20to%20the%20%2A%2ACalculated%20Columns%2A%2A%20tab%20%5B%5B1%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/components/Datasource/DatasourceEditor.jsx%23L1742-L1780%29.%0A%0A3.%20Click%20%2A%2A%22%2B%20Add%20item%22%2A%2A%20and%20create%20a%20column%20called%20%60month_order%60%20with%20a%20SQL%20expression%20like%3A%0A
%0A%20%20%20%60%60%60sql%0A%20%20%20EXTRACT%28MONTH%20FROM%20your_date_column%29%0A%20%20%20%60%60%60%0A%0A%20%20%20Or%20if%20your%20months%20are%20text%20labels%3A%0A%0A%20%20%20%60%60%60sql%0A%20%20%20CASE%20%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27January%27%20THEN%201%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27February%27%20THEN%202%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27March%27%20THEN%203%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27April%27%20THEN%204%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27May%27%20THEN%205%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27June%27%20THEN%206%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27July%27%20THEN%207%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27August%27%20THEN%208%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27September%27%20THEN%209%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27October%27%20THEN%2010%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27November%27%20THEN%2011%0A%20%20%20%20%20WHEN%20month_name%20%3D%20%27D
ecember%27%20THEN%2012%0A%20%20%20END%0A%20%20%20%60%60%60%0A%0A4.%20Save%20the%20dataset.%20Then%20create%20a%20%2A%2Ametric%2A%2A%20on%20this%20column%20%28e.g.%2C%20%60MIN%28month_order%29%60%29%20in%20the%20%2A%2AMetrics%2A%2A%20tab%20%E2%80%94%20this%20is%20needed%20because%20the%20Sort%20Metric%20dropdown%20works%20with%20metrics%2C%20not%20raw%20columns%20%5B%5B2%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1120-L1174%29.%0A%0A%2A%2AStep%202%20%E2%80%94%20Configure%20the%20dashboard%20filter%2A%2A%0A%0A1.%20Open%20your%20dashboard%20in%20%2A%2Aedit%20mode%2A%2A.%0A2.%20Click%20the%20%2A%2Agear%20icon%2A%2A%20on%20the%20filter%20bar%20and%20select%20%2A%2A%22Add%20or%20edit%20filters%22%2A%2A%20%5B%5B3%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/d
ashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx%23L165-L176%29.%0A3.%20Select%20your%20month%20filter%20%28or%20create%20a%20new%20one%29.%0A4.%20Scroll%20down%20to%20the%20%2A%2A%22Sort%20filter%20values%22%2A%2A%20section%20and%20expand%20it%20%5B%5B4%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1080-L1082%29.%0A5.%20Set%20%2A%2ASort%20type%2A%2A%20to%20%22Sort%20ascending%22%20%5B%5B5%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1088-L1119%29.%0A6.%20In%20the%20%2A%2ASort%20Metric%2A%2A%20dropdown%2C%20select%20the%20metric%20you%20created%20%28e.g.%2C%20%60MIN%28month_order%29%60%29%20%5B%5B6%5D%5D%28https%3A//github.com/apache/sup
erset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1137-L1142%29.%0A7.%20Save%20the%20filter%20configuration.%0A%0AYour%20month%20filter%20should%20now%20display%20months%20in%20chronological%20order%20%28January%20%E2%86%92%20December%29%20instead%20of%20alphabetical.%0A%0ALet%20me%20know%20what%20database%20you%27re%20using%20if%20you%20need%20help%20with%20the%20exact%20SQL%20syntax%20for%20the%20calculated%20column%21) [](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/39308)
GitHub link: https://github.com/apache/superset/discussions/39308#discussioncomment-16539879
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] FILTER SORT ORDER [superset]
Posted by "srijani-smsrc (via GitHub)" <gi...@apache.org>.
GitHub user srijani-smsrc added a comment to the discussion: FILTER SORT ORDER
@dosu
how to do this in dashboard filters.
GitHub link: https://github.com/apache/superset/discussions/39308#discussioncomment-16539782
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] FILTER SORT ORDER [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] edited a comment on the discussion: FILTER SORT ORDER
<!-- Answer -->
Here's how to set it up directly in the dashboard filter UI:
**Step 1 — Add a calculated column to your dataset**
1. Go to **Datasets**, find your dataset, and click **Edit**.
2. Go to the **Calculated Columns** tab [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/components/Datasource/DatasourceEditor.jsx#L1742-L1780).
3. Click **"+ Add item"** and create a column called `month_order` with a SQL expression like:
```sql
EXTRACT(MONTH FROM your_date_column)
```
Or if your months are text labels:
```sql
CASE
WHEN month_name = 'January' THEN 1
WHEN month_name = 'February' THEN 2
WHEN month_name = 'March' THEN 3
WHEN month_name = 'April' THEN 4
WHEN month_name = 'May' THEN 5
WHEN month_name = 'June' THEN 6
WHEN month_name = 'July' THEN 7
WHEN month_name = 'August' THEN 8
WHEN month_name = 'September' THEN 9
WHEN month_name = 'October' THEN 10
WHEN month_name = 'November' THEN 11
WHEN month_name = 'December' THEN 12
END
```
4. Save the dataset. Then create a **metric** on this column (e.g., `MIN(month_order)`) in the **Metrics** tab — this is needed because the Sort Metric dropdown works with metrics, not raw columns [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1120-L1174).
**Step 2 — Configure the dashboard filter**
1. Open your dashboard in **edit mode**.
2. Click the **gear icon** on the filter bar and select **"Add or edit filters"** [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx#L165-L176).
3. Select your month filter (or create a new one).
4. Scroll down to the **"Sort filter values"** section and expand it [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1080-L1082).
5. Set **Sort type** to "Sort ascending" [[5]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1088-L1119).
6. In the **Sort Metric** dropdown, select the metric you created (e.g., `MIN(month_order)`) [[6]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1137-L1142).
7. Save the filter configuration.
Your month filter should now display months in chronological order (January → December) instead of alphabetical.
Let me know what database you're using if you need help with the exact SQL syntax for the calculated column!
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=a6139cc3-1ae6-4363-a2c3-62ecffcffcf5) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/39308#discussioncomment-16539879
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] FILTER SORT ORDER [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] edited a comment on the discussion: FILTER SORT ORDER
<!-- Answer -->
You're on the right track with the approach you described! Superset's native filters have a built-in **Sort Metric** feature that handles exactly this. Here's how to get months sorted chronologically:
1. **Add a numeric sort column to your dataset** — Create a calculated column (e.g., `month_order`) that maps each month to its numeric value (January → 1, February → 2, … December → 12). You can do this in your database view/query or as a calculated column in the Superset dataset. For example in SQL: `EXTRACT(MONTH FROM your_date_column) AS month_order`.
2. **Configure the filter's sort settings** — In your dashboard's native filter configuration panel, expand the **"Sort filter values"** section [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1082). There you'll find:
- **Sort type** — Set to ascending [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1107-L1111)
- **Sort Metric** — Select your `month_order` column here [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1134)
This tells Superset to display the month name in the filter dropdown but sort the values using the numeric `month_order` column instead of alphabetically [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/filters/components/Select/types.ts#L44).
The same approach works for quarters or any other values you need in a custom order. This works in Superset 5 — it's part of the native filter configuration UI, no code changes needed.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=de045022-c315-4469-8a06-f43b75fcea28) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/39308#discussioncomment-16539760
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org