Forum Discussion
Sort Date hierarchy with year
- Anonymous5 years ago
Hi mmoroni ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. If no, please provide some sample data with Text format and expected result with examples. Thank you.
1. Create a custom column to get YearMonth in Power Query Editor
2. Create another month name to replace the month of date hierarchy
Month = FORMAT('Table'[Date],"mmmm")Best Regards
Add a column to your Dates table like this.
Month Year Date = EOMONTH ( Dates[Date], 0 )
This will give us the last date of each month.
Then go to the model view and select that column to apply custom formatting and put in the format 'mmm yyyy'
Then use the Dates[Month Year Date] column in your visual. It is formatted to show the correct string but also sorts in the correct order automatically.
Thank you for your suggestion. However, it did not resolve my issue. I need column headers for each mmmm yyyy to be in proper order, and this did not resolve that 😞
- jdbuchanan715 years agoSuper User
Please share your .pbix file. You can post it to DropBox or OneDrive and share the link here. If implement correctly my suggestion will do what you are wanting.