Forum Discussion
Newbie Question on Sorting Columns
- 6 years ago
Anonymous read this topic for sort by, you don't change anything on the visual, x-axis will still be the same, Week Name
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
I do have a day column in the data. Here is a sample of the fake data:
date day x
1 2020-05-04 Monday 12
2 2020-05-04 Monday 7
3 2020-05-04 Monday 6
4 2020-05-05 Tuesday 13
5 2020-05-05 Tuesday 5
6 2020-05-05 Tuesday 13
7 2020-05-06 Wednesday 1
8 2020-05-06 Wednesday 4
9 2020-05-06 Wednesday 10
10 2020-05-07 Thursday 1
11 2020-05-07 Thursday 14
12 2020-05-07 Thursday 9
13 2020-05-08 Friday 4
14 2020-05-08 Friday 10
15 2020-05-08 Friday 8
16 2020-05-11 Monday 9
17 2020-05-11 Monday 2
18 2020-05-11 Monday 15
19 2020-05-12 Tuesday 15
20 2020-05-12 Tuesday 4
21 2020-05-12 Tuesday 10
22 2020-05-13 Wednesday 10
23 2020-05-13 Wednesday 13
24 2020-05-13 Wednesday 12
25 2020-05-14 Thursday 2
26 2020-05-14 Thursday 14
27 2020-05-14 Thursday 10
28 2020-05-15 Friday 8
29 2020-05-15 Friday 8
30 2020-05-15 Friday 10
31 2020-05-18 Monday 1
32 2020-05-18 Monday 11
33 2020-05-18 Monday 1
34 2020-05-19 Tuesday 12
35 2020-05-19 Tuesday 6
36 2020-05-19 Tuesday 14
37 2020-05-20 Wednesday 9
38 2020-05-20 Wednesday 4
39 2020-05-20 Wednesday 9
40 2020-05-21 Thursday 7
41 2020-05-21 Thursday 7
42 2020-05-21 Thursday 11
43 2020-05-22 Friday 1
44 2020-05-22 Friday 11
45 2020-05-22 Friday 13
It seems to sort alphabetically. If it's ascending, it starts with Friday and goes to Wednesday. If descending, it starts with Wednesday and goes to Friday.
Should I create a column with 1 for Monday, 2 for Tuesday, and so on, please?
Thanks. Sorry for all of the trouble.
Anonymous yes you are on right track you can add weekday column by using following expression
Weekday Number = WEEKDAY ( DateTable[Date] )
select Day column and on the menu under column tools, sort it by weekday number column that created from the above expression and that will do it
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
- parry2k6 years agoSuper User
Anonymous read this topic for sort by, you don't change anything on the visual, x-axis will still be the same, Week Name
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
- Anonymous6 years agoNot applicable
Great!
One last question, please. So now I have the data sorted by Weekday number. I would like the X axis labels to appear as the Alpha Date Name rather than the number. How can I do that, please?
Thanks again.
- Anonymous6 years agoNot applicable
That is absolutely it!
Thanks so much!!!!!
Sincerely,
Erin