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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Shrutee99
Frequent Visitor

I want to have a column showing week number from a date column.

So I want my date column over 3 years (in format dd-mm-yyyy) to transform something into the week number table below such as the start date will be 1 Jan irrespective of year. 

Any help is welcome

Start Date

End Date

Week Number

01-Jan

07-Jan

W1

08-Jan

14-Jan

W2

15-Jan

21-Jan

W3

22-Jan

28-Jan

W4

2 REPLIES 2
Shrutee99
Frequent Visitor

Thanks for the reply.

However, I have one exception too. Could you please help me with that?

As Feb 2020 is a leap year, and I want to compare weeks of 4 years side by side, I need Feb 29th to be grouped in week9(26 Feb-04 March) which will contain 8 days. How do I make an exception week for 8 days? As this data is fetched from excel, I can modify some columns in excel too, so any help in excel is also welcome!

26-Feb

04-Mar

 W9

05-Mar

11-Mar

 W10

12-Mar

18-Mar

 W11

wdx223_Daniel
Super User
Super User

NewStep=Table.AddColumn(PreviousStepName,"Week Number",each "W"&Number.ToText(Date.WeekOfYear([Start Date],Day.Sunday),"00"))

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors