Forum Discussion
Sort slicer with text and dates
Hello!
Is there any way to sort this slicer with dates and text? text is fine, but dates are random.
Thanks
You are almost there...
Add another column with something like:
Table.AddColumn(HomologousMonth, "MonthSlicerSortOrder",
each if [CurrentMonth] then 999
else if [PreviousMonth] then 998
else if [HomologousMonth] then 997
else [MonthIndex])
And in your data model use this column as the Sort by column for the MonthSlicer column.
4 Replies
- Greg_DecklerCommunity Champion
Can you create a column, something like:
FORMAT([Date],"yyyyMM")
Use that as the Sort By column for the column in your slicer?
- gonrodriguesHelper III
I have that column in my 'calendar' table (Month), but i need to use the 'MonthSlicer' column in slicer
MonthSlicer:
Table.AddColumn(HomologousMonth, "MonthSlicer", each if [CurrentMonth] then "Current Month" else if [PreviousMonth] then "Previous Month" else if [HomologousMonth] then "Homologous Month" else [Month])
- waltheedImpactful Individual
You are almost there...
Add another column with something like:
Table.AddColumn(HomologousMonth, "MonthSlicerSortOrder",
each if [CurrentMonth] then 999
else if [PreviousMonth] then 998
else if [HomologousMonth] then 997
else [MonthIndex])
And in your data model use this column as the Sort by column for the MonthSlicer column.