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
mcnater
Advocate I
Advocate I

Week Start calculation

I'd love to be able to group my dates into Week Start buckets. In Qlikview there is a WeekStart() function where you provider a date and it groups dates into weeks, depending on the date and offset you provider so you can easily do this. I'm not finding something similar in PBI yet. Does anyone know how to do this?  Basically looking to add 1 new column to my calendar table. I already have the weeks numbered, but I need the "display" value now so we'd see thing slike 6/2/2018, 6/9/2018, 6/16/2018 and so on as the labels. 

1 ACCEPTED SOLUTION

Ok...so this appears to work and do what I need:

 

WeekStart

= Table.AddColumn(#"WeekStart", each Date.ToText(Date.StartOfWeek([Date], Day.Sunday),"MM/dd/yyyy"))

 

WeekStart_WeekEnd

= Table.AddColumn(#"WeekStart_WeekEnd", each Date.ToText(Date.StartOfWeek([Date], Day.Sunday),"MM/dd/yyyy") & "-" & Date.ToText(Date.EndOfWeek([Date], Day.Sunday),"MM/dd/yyyy"))

 

 

 

I'll leave this here so the next person trying this can hopefully find it and not bang their head for a full day.


I appreciate all the help.

 

 

 

 

View solution in original post

14 REPLIES 14

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.