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
vat2do
Helper II
Helper II

Week No with Month and year no

Hope you have great day,

 

I need support to get the out put in new column as "Week 1 January 22" from the date table created using calender auto showing one year dates in power query.

 

Thanks in advance

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@vat2do 

just like what @Rudy_D  said, you can't create the column in PQ if you use dax to create a table.

pls try this

 

Column = "Week " & WEEKNUM('Table'[Date],2) &" "& format('Table'[Date],"mmmm")&" "& right(year('Table'[Date]),2)
 
or 
 
Column 2 = "Week " & ROUNDDOWN(('Table'[Date]-min('Table'[Date]))/7,0)+1 &" "& format('Table'[Date],"mmmm")&" "& right(year('Table'[Date]),2)
 
1.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

8 REPLIES 8
ryan_mayu
Super User
Super User

@vat2do 

just like what @Rudy_D  said, you can't create the column in PQ if you use dax to create a table.

pls try this

 

Column = "Week " & WEEKNUM('Table'[Date],2) &" "& format('Table'[Date],"mmmm")&" "& right(year('Table'[Date]),2)
 
or 
 
Column 2 = "Week " & ROUNDDOWN(('Table'[Date]-min('Table'[Date]))/7,0)+1 &" "& format('Table'[Date],"mmmm")&" "& right(year('Table'[Date]),2)
 
1.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




vat2do
Helper II
Helper II

i created simple date table with column name "Date" using "CALENDARAUTO()" expression

If you used Calendarauto(), I guess you have created the table in Dax.

So you cannot add the column requested using power query. But I can show you how to do it in Dax.

Yes i am using DAX, appreciated to have a solution thanks

You can use this formula :

 

Newcolumn = CONCATENATE("Week ",CONCATENATE(WEEKNUM('Table'[Date]), CONCATENATE(" ", CONCATENATE(FORMAT('Table'[Date], "MMM"), CONCATENATE(" ", YEAR('Table'[Date]))))))
 
Rudy_D_0-1660810148987.png

 

hi,

your solution is useful to me, another quick question, how i can repeat the week numbers when a month name changes like week 1, week2, week3 and week 4 for January but i need to repeat starting from week 1 to week 4 in february and so on

@vat2do 

you can try this

Column 2 = "Week " & ROUNDDOWN(('Table'[Date]-min('Table'[Date]))/7,0)+1 &" "format('Table'[Date],"mmmm")&" "right(year('Table'[Date]),2)

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Rudy_D
Resolver I
Resolver I

Hi,

 

Could you please describe the date table from which you want to create the new column ?

 

Thanks

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.