- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
to convert a date to a format 'dd-mmm-yyyy' and should be able to sort the field in powerbi
Hi,
Is there a way we could bring in a field to a format 'dd-mmm-yyyy' and still be able to sort. (I understand the Format function will help me with the format but it wouldnt let me sort as it would it be a text.)
Thanks in Advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry. I'm not quite sure I understand you.
These two are calculated columns:
format_Date = FORMAT(Query1[Date], "dd-mmm-yyyy") date_Sort = RANKX(Query1, [Date],,ASC, Dense)
Sort Ascending by date_Sort
Change Header options:
hide date_Sort:
Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use this method:
In a calculated column:
date_Sort = RANKX(Query1, [Date],,ASC, Dense)
Next, put your formatted date and the sort into a visual. In the Format Property under Column Headers, turn both off "Auto-size column width" and "Word Wrap". Sort your date and then "hide" your date_Sort field.
Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your suggestion. There is one issue .. the RANKX function would order text output ( which is from the format function for'dd-mmm-yyyy') only in the alphabetical order first..
example (choose ascending)
05-Apr-2016
05-Apr-2017
05-Aug-2016
05-Aug-2017
06-Apr-2018
06-Aug-2018
30-Dec-2016
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry. I'm not quite sure I understand you.
These two are calculated columns:
format_Date = FORMAT(Query1[Date], "dd-mmm-yyyy") date_Sort = RANKX(Query1, [Date],,ASC, Dense)
Sort Ascending by date_Sort
Change Header options:
hide date_Sort:
Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - January 2025
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
Subject | Author | Posted | |
---|---|---|---|
06-17-2024 03:50 AM | |||
08-25-2024 10:54 AM | |||
12-20-2023 03:37 AM | |||
Anonymous
| 10-30-2017 05:10 PM | ||
02-19-2024 06:37 AM |
User | Count |
---|---|
100 | |
69 | |
42 | |
37 | |
30 |
User | Count |
---|---|
157 | |
89 | |
62 | |
46 | |
40 |