Sort By Day of Week PowerBI

It’s a common scenario where you’d want to display data in a chart based on Day of the Week and it obviously will look good if sorted by the Day of Week starting say Monday.

In this scenario, my Model has sample Incidents data used by a team for the number of Incidents raised over a period of time. I’ve created a Measure for the Total Count of Incidents as below:

Total Count = COUNT(IncidentsData[Incident #])

I’m using a Stacked Column chart for the display purpose, so I need to create a column Weekday that will be calculated from the Created Date of the Incident.

WEEKDAY = FORMAT('IncidentsData'[Created Date & Time],"DDDD")

Create another column that shows the default number of the Weekday as below:

WEEKDAY-NR = WEEKDAY(IncidentsData[Created Date & Time], 2)

Now select the column Weekday column in the Model, Go to Sort by Column menu and Select the column Weekday-NR as the Sort order. This tells Power BI to sort Weekday Column by Weekday-NR.

Make sure to select Weekday as your sort column in the Stacked Column chart.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.