Forum Discussion
PBI Sort Week according
- 1 year ago
Hello tan_thiamhuat
You have to create a week number and sort the weekname column by using week number column. then you will get the expected week order in your line chart.
M-Code I used to create the week number column is
= Table.AddColumn(#"Inserted Day Name", "Day of Week", each Number.Mod(Date.DayOfWeek([SalesDate], Day.Monday), 7), Int64.Type)After creating this column select the weekname column from Table view and go to sort by column and select week number column. then automatically it will sort week from Monday to sunday.
Now you will get expected your result.
Attached pbix file for your reference. Please let me know if it works.
Thank you!!
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
Hello tan_thiamhuat
You have to create a week number and sort the weekname column by using week number column. then you will get the expected week order in your line chart.
M-Code I used to create the week number column is
= Table.AddColumn(#"Inserted Day Name", "Day of Week", each Number.Mod(Date.DayOfWeek([SalesDate], Day.Monday), 7), Int64.Type)
After creating this column select the weekname column from Table view and go to sort by column and select week number column. then automatically it will sort week from Monday to sunday.
Now you will get expected your result.
Attached pbix file for your reference. Please let me know if it works.
Thank you!!
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!