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.
Hi,
Please can someone let me know how to sort a column in a table by week day (ie Mon, Tue, Wed etc), I have tried to do this via the sort by column button, however I dont seem to get the same options as shown sources.
Please see below visual of the table. Any help would be much appreciated.
Hi,
Is this what you meant ? the data used is from the "2023 Raw Data" file and i'm using the "Day" data.
Hello @NLEIGH !
In Power BI, follow these steps:
Click on the "Modeling" tab in the Power BI Desktop application.
New Column: In the "Modeling" tab, click on the "New Column" option. This will allow you to create a custom column that you can use for sorting. In the formula bar that appears, enter this DAX formula that assigns a numerical value to each of the week days:WeekdayOrder = SWITCH([Weekday], "Mon", 1, "Tue", 2, "Wed", 3, "Thu", 4, "Fri", 5, "Sat", 6, "Sun", 7)
In this formula, "Weekday" should be replaced with the name of your column containing the week days.
Now select the original column (the one with Mon, Tue...) and then on the column tools use the Sort By Column and choose the new costum column we just created.
Remember to adjust the DAX formula if your week day column contains different values or labels for week days.
Hi Jorge, Many thanks for taking the time to reply. I have tried to follow the steps (i'm still new to Power Bi), however i'm getting this error message when I try to sort by the new column I've created.
I've also attached below a screenshot of the new column measure just in case that helps
Do you have any idea what i've done wrong
Many thanks
Can you show your data model please?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |