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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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 .

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 .

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

 

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 .

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

 

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

Try this - 

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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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