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
Anonymous
Not applicable

Visuals With Day-Of-The-Week: How to Get "Monday"-"Sunday" Instead of an Integer to Represent a Day

I found a DAX code that works with direct query to group all of my values by day-of-the-week:  

Weekday = WEEKDAY([ReportDate],2)
 
However, this only groups by the number of the week.  I don't want a number to represent the day because users dont' know if "1" is Sunday or Monday.  How can I get the actual text days of the week at the bottom of this chart instead of numbers?
 
2019-09-19_102419.jpg
1 ACCEPTED SOLUTION

Hi @Anonymous ,

I have two ways to implement it.

1. Use the function of Format . Below is my formula of calculated column that you can have a try.

Column = FORMAT(financials[Date],"dddd")

2.PNG

2. Create a new group. This is based on the column that created by WEEKDAY.

3.PNG4.PNG5.PNG

Note : The data type of the column will be shown as text for the two ways.

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
GunnerJ
Post Patron
Post Patron

So this is likely not the best way but what you could do is create a seperate column that gives a numeric value to all days of the week with Monday beign the lowest and Sunday the greatest. Then when you have the days of the week selected "sort by" the numeric column.

Anonymous
Not applicable

I thought about it long and hard, but I guess I'm not tracking how to accomplish this.  Seems like this wouldn't be something that would need a work around.  Assigning a numerical digit to represent a day is just dumb...

Hi @Anonymous ,

I have two ways to implement it.

1. Use the function of Format . Below is my formula of calculated column that you can have a try.

Column = FORMAT(financials[Date],"dddd")

2.PNG

2. Create a new group. This is based on the column that created by WEEKDAY.

3.PNG4.PNG5.PNG

Note : The data type of the column will be shown as text for the two ways.

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks for that response.  I wound up creating the day-of-the-week field in SQL Server Management Studio and pushing the new table to PowerBI.  There's a lot more information out there about how to do this in SQL.  I have been very frustrated trying to implement this with code in PowerBI.  Why would they not just use what coding language that's already established instead of going with DAX rather than Excel or TSQL!  I hate having to unlearn how to create formulas.  Plus many of the Dax formulas are designed to be incompatible with a direct query.  The more I use PowerBI, the more I hate it.  It's like a toy or a puzzle to solve more than it is a utility.

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.