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
Sami95
Regular Visitor

Dax Sorting weekday in Chronological order

zxasS.PNG
Hello World,

I have created a visualization where I sort the axis by weekday. But it is not giving me the weekday in chronological order. How do I fix this. I want the starting day of the week from Sunday (USA weekday).

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Sami95 ,

 

Create columns like below:

t_weekdays = WEEKDAY('Table'[date],1)

t_day = FORMAT('Table'[Date], "dddd")

Put t_day in x-asix field, t_weekdays in tooltips field.

Then sort the visual by tooltips column.

vjaywmsft_0-1669714202905.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @Sami95 ,

 

Create columns like below:

t_weekdays = WEEKDAY('Table'[date],1)

t_day = FORMAT('Table'[Date], "dddd")

Put t_day in x-asix field, t_weekdays in tooltips field.

Then sort the visual by tooltips column.

vjaywmsft_0-1669714202905.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Jihwan_Kim
Super User
Super User

Hi,

In the calendar table, try to create a new column for the sorting purpose. like the attached pbix file.

And then, click Weekday column -> sort by Weekday sort CC.

 

 

Please check the attached pbix file.

 

 

Weekday sort CC = 
WEEKDAY([Date],1)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


I have a column "Day". I created a new column. But it's giving me an error

Calendar =
ADDCOLUMNS (
    CALENDAR ( DATE ( 2022, 1, 1 ), DATE ( 2022, 12, 31 ) ),
    "Weekday", FORMAT ( [Date], "dddd" )
)

Hi @Sami95 
Please try new column then use it a sort by column

Weekday Number =
WEEKDAY ( 'Calendar'[Date], 1 )

 

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.

Top Solution Authors