Forum Discussion
Sort Week Day Names by Date
- 4 years ago
I think I found a bug in PowerBI, if you intitially setup the sort of WEEKDAYNAME to be by WEEKDAYNUM = WEEKDAY([date]) and then change the formula of WEEKDAYNUM = DATEVALUE([date]) it continue to sort correctly on the graph. If you try to sort it by column again then it gives this error. That said, this may not be the best solution so please find another solution below
Put the date on the X Axis and change the format of date to be 'ddd'. Make sure the X axis is changed from Continuous to Categorical. Also if you need to keep the oringinal date column as well you can simply make the WeekDayNum a duplicate of the Date column using = [Date]. Let me know if this works
I see that you get the result I need, but it does not allow me to sort WeekdayName by weekdayNum.
I think I found a bug in PowerBI, if you intitially setup the sort of WEEKDAYNAME to be by WEEKDAYNUM = WEEKDAY([date]) and then change the formula of WEEKDAYNUM = DATEVALUE([date]) it continue to sort correctly on the graph. If you try to sort it by column again then it gives this error. That said, this may not be the best solution so please find another solution below
Put the date on the X Axis and change the format of date to be 'ddd'. Make sure the X axis is changed from Continuous to Categorical. Also if you need to keep the oringinal date column as well you can simply make the WeekDayNum a duplicate of the Date column using = [Date]. Let me know if this works
- OlegV4 years agoHelper III
It worked, thank you! So there are two ways to sort WeekDayName by Date
1) plot a column "Date" on an x-axis -> change format of a column "Date" to "ddd" -> change x-axis type from Continuous to Categorical;
2) create a column WeekDayNum using a formular = WEEKDAY('Table'[Date]) -> sort WeekDayName column by WeekDayNum -> change formular in WeekDayNum column to DATEVALUE('Table'[Date]).