Forum Discussion

hxkresl's avatar
hxkresl
Advocate III
9 years ago
Solved

Need date sorting on bar graph

How to get dates sorting chronologically in bar graph?     Data set looks like this:    Tried to sort Date by cte_start_date I get error:  "We can't sort the 'Date' column by 'cte_sta...
  • Anonymous's avatar
    Anonymous
    9 years ago

    hxkresl,

    Create a new column in your table using the following DAX, then use the column to sort your Date column. For more details, please review this modified PBIX file.

    Column = DATE(YEAR(OutageTrending_hour[cte_start_date]),MONTH(OutageTrending_hour[cte_start_date]),DAY(OutageTrending_hour[cte_start_date]))


    Regards,

     

  • hxkresl's avatar
    hxkresl
    9 years ago

    Anonymous MattAllington

    The key to sorting a *text* date column by another column is that the column used for sorting is set to Datetype: Date or Datetype: Whole number.