Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
d_sandip59
Helper I
Helper I

How to sort the week day names as Monday, Tuesday and Wednesday like this at week day drop down?

Hi,

I have used the below DAX

WeekDay = format(Test[FIRST_TOUCH_DATE_TIME],"dddd")

and it gives me this:

Saturday, sunday, Monday i.e Week day names, but I nned to show the name in a sorted order like Monday, Tuesday, Wednesday..

Currently it is hown as below, so how can I achieve this?

Capture12.PNG

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @d_sandip59

There is no direct option to sort week day, try to sort manually by the following way-

  1. Create a calculated column and write the below DAXWeekDay Sort = SWITCH(Table1[WeekDay],"Monday",01,"Tuesday",02,"Wednesday",03,"Thursday",04,"Friday",05,"Saturday",06,"Sunday",07,08)
  2. Sort "WeekDay Name" column by "WeekDay Sort" Column under the Modeling tab in ribbon palet.

Capture.PNG

For more details see the pbix file. Hope this will help you!!!

Download pbix file

View solution in original post

14 REPLIES 14
Zhengy
Advocate I
Advocate I

This will create an error, " A circular dependency was detected". 

Anonymous
Not applicable

Hi @d_sandip59

There is no direct option to sort week day, try to sort manually by the following way-

  1. Create a calculated column and write the below DAXWeekDay Sort = SWITCH(Table1[WeekDay],"Monday",01,"Tuesday",02,"Wednesday",03,"Thursday",04,"Friday",05,"Saturday",06,"Sunday",07,08)
  2. Sort "WeekDay Name" column by "WeekDay Sort" Column under the Modeling tab in ribbon palet.

Capture.PNG

For more details see the pbix file. Hope this will help you!!!

Download pbix file

Anonymous
Not applicable

Hi ,

I created a measure and done all the required things , in table the data is sorted but in visual (line graph) it is not sorted . Suggestions appreciated ..!

Thanks .

saud968
Responsive Resident
Responsive Resident

I have the below two measures I am not getting the sort option in modelling also, I using this in matrix visual.

DayText = SWITCH(support__cw_ops_manage_case_merge_temp[WeekDaySort], 1, "Monday", 2, "Tuesday", 3, "Wednesday", 4, "Thursday", 5, "Friday", 6, "Saturday", 7, "Sunday", "Unknown")
WeekDaySort = SWITCH(support__cw_ops_manage_case_merge_temp[Day], "Monday", 1, "Tuesday", 2, "Wednesday", 3, "Thursday", 4, "Friday", 5, "Saturday", 6, "Sunday", 7, 8)
LivioLanzo
Solution Sage
Solution Sage

hi @d_sandip59

 

Add a new column with the weekday number and then sort Weekday by WeekDay number in Table view

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Anonymous
Not applicable

Hi LivioLanzo ,

I tried same as u said but i got an error <refer to img attached>

error_ss.png

Please can u suggest anything ??

Thanks .

saud968
Responsive Resident
Responsive Resident

in the date table create a new column like this
and you need to pull it out onto the matrix instead of your column

saud968_0-1701332369971.png

 

saud968_1-1701332369482.png

 

 

Anonymous
Not applicable

Error :

sailochana_0-1701335379611.png

 

saud968
Responsive Resident
Responsive Resident

use these - 

WeekDaySort = SWITCH(Day], "Monday", 1, "Tuesday", 2, "Wednesday", 3, "Thursday", 4, "Friday", 5, "Saturday", 6, "Sunday", 7, 8) and 
DayText = SWITCH([WeekDaySort], 1, "Monday", 2, "Tuesday", 3, "Wednesday", 4, "Thursday", 5, "Friday", 6, "Saturday", 7, "Sunday", "Unknown")

and then use the previously given dax
Anonymous
Not applicable

Thanks Dude .

saud968
Responsive Resident
Responsive Resident

You are welcome, glad to help.

Anonymous
Not applicable

Even if I try direct connection between week and weeknumber then I found the below error 

sailochana_1-1701335588233.png

 

saud968
Responsive Resident
Responsive Resident

This is for sorting the column by week day name and not week number so the one I shared it will not work. 

saud968
Responsive Resident
Responsive Resident

Try this - 

Day Name_ = REPT(UNICHAR(8203),7-(Weekdaysortedcolumn)&(dayname)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.