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
sukajalan2
Frequent Visitor

Date.EndOfWeek issue

Hi.

 

I have a problem with Date formula.

 

I created a column for the date of Friday of the previous weeek using the formula below and the result is good. Apr 21 is the friday of last week.

dates.jpg

 

 

 

 

 

 

 

 

 

 

 

However, the date changed to Apr 20 when I changed the column type to Date:

dates2.jpg

 

 

 

 

 

 

 

 

 

 

 

Does anybody know what causes the date to shift by 1 day? Is this a bug?

 

 

 

 

 

1 ACCEPTED SOLUTION
MarcelBeug
Community Champion
Community Champion

No, it is not a bug. With Day.Friday, you indicate that Friday is the first day of the week.

 

The end of the week is on April 20, just before midnight (as you can see in the bottom of the editor, if you select the datetime value), which gets rounded to April 21, 12:00:00 AM:

 

Date.EndOfWeek issue.png

 

So if you take the date, it is April 20.

 

If you replace Day.Friday with Day.Saturday, then you get your desired result.

Specializing in Power Query Formula Language (M)

View solution in original post

1 REPLY 1
MarcelBeug
Community Champion
Community Champion

No, it is not a bug. With Day.Friday, you indicate that Friday is the first day of the week.

 

The end of the week is on April 20, just before midnight (as you can see in the bottom of the editor, if you select the datetime value), which gets rounded to April 21, 12:00:00 AM:

 

Date.EndOfWeek issue.png

 

So if you take the date, it is April 20.

 

If you replace Day.Friday with Day.Saturday, then you get your desired result.

Specializing in Power Query Formula Language (M)

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.