Forum Discussion
bslozano
1 year agoFrequent Visitor
Sort MonthYear with Unscheduled
I have a MonthYear column in MonthName Year format. I was able to sort that by creating a different column. Now within the MonthYear column, there are some rows that the values are "Unscheduled". How...
- 1 year ago
Hi bslozano,
In your table, add a new calculated column using this DAX:
SortOrder = IF( TableName[MonthYear] = "Unscheduled", 999999999, YEAR(DATEVALUE("1 " & TableName[MonthYear])) * 100 + MONTH(DATEVALUE("1 " & TableName[MonthYear])) )Replace TableName with your table's name.
For rows where MonthYear is "Unscheduled", the formula assigns a high value (999999999) to place it at the end.
For other rows, the formula calculates a numeric value based on the Year and Month (e.g., 202501 for January 2025).
Bibiano_Geraldo
1 year agoSuper User
Hi bslozano,
In your table, add a new calculated column using this DAX:
SortOrder =
IF(
TableName[MonthYear] = "Unscheduled",
999999999,
YEAR(DATEVALUE("1 " & TableName[MonthYear])) * 100 + MONTH(DATEVALUE("1 " & TableName[MonthYear]))
)Replace TableName with your table's name.
For rows where MonthYear is "Unscheduled", the formula assigns a high value (999999999) to place it at the end.
For other rows, the formula calculates a numeric value based on the Year and Month (e.g., 202501 for January 2025).