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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Timour
New Member

Issue with WEEKDAY returning 7 for monday

Hello everyone,


I am facing an issue with WEEKDAY(). I lookep it up online but couldn't find anything similar.


1 - Case when it works
So, I am writing this question on April 19th which is actually a Sunday.
When I use this 

Screenshot_7.jpg

It actually works and give me 7 as an answer
Screenshot_8.jpg
2 - Case when it doesn't work

But when I try to do it with a column of my table

Colonne 2 = WEEKDAY('POWERBI_DATA'[Ref_Last_Pending_Date_Format];2)

This is what I get :
Screenshot_9.jpg
So you can see on the screeshot above that I get results of 7 for mondays instead of 1.

I have no idea why this is happening. I was just trying to get the average amount of operations per weekday (excluding weekends) so I excluded 6 and 7 but the figures didn't make sense until I noticed this...so now when I exclude 5 and 6 (which are then Saturdays and Sundays...) the figures are correct.

I don't know if this could be part of the issue but just so you know : 

   - the column Ref_Last_Pending_Date_Format is calculated based on the column Last_Pending_Date (text) as follows : DATEVALUE('POWERBI_DATE'[Last_Pending_Date])
   - The date format is DD/MM/YYYY


Thank you in advance for your help and ideas

Tim

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Timour 

1. Is your date of DD/MM/YYYY has been deteted as date?

2. Have you tried using

Colonne 2 = WEEKDAY('POWERBI_DATA'[Ref_Last_Pending_Date_Format].date;2)

3. Create a new date like this and try

new Date  = date(right('POWERBI_DATA'[Ref_Last_Pending_Date_Format],4),mid('POWERBI_DATA'[Ref_Last_Pending_Date_Format],4,2),left('POWERBI_DATA'[Ref_Last_Pending_Date_Format],2))

 

4. In case all you date are in DD/MM/YYYY format try

https://community.powerbi.com/t5/Desktop/How-to-apply-UK-date-format-dd-mm-yyyy-in-Date-slicer/td-p/...

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Timour 

1. Is your date of DD/MM/YYYY has been deteted as date?

2. Have you tried using

Colonne 2 = WEEKDAY('POWERBI_DATA'[Ref_Last_Pending_Date_Format].date;2)

3. Create a new date like this and try

new Date  = date(right('POWERBI_DATA'[Ref_Last_Pending_Date_Format],4),mid('POWERBI_DATA'[Ref_Last_Pending_Date_Format],4,2),left('POWERBI_DATA'[Ref_Last_Pending_Date_Format],2))

 

4. In case all you date are in DD/MM/YYYY format try

https://community.powerbi.com/t5/Desktop/How-to-apply-UK-date-format-dd-mm-yyyy-in-Date-slicer/td-p/...

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.