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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jderekc
Helper IV
Helper IV

DAX formula to show week of the month, not week of the year

Hi all,

 

I've been browsing the internet for ways to show the current week of any given month but all I've come across is week number of the year.  Is it possible to show week of the month?  For instance, instead of week 31/32, it would be week 1 of August.  This may pose a problem if weeks carryover from one month to another though.  See my screenshot below for how it currently looks.  Also, my existing DAX query is also below:

 

daxweeks.PNG

 

DAX formula:

Week = " Week " & WEEKNUM(VendDisplay[DateCreated], 2) & " - " & FORMAT(VendDisplay[DateCreated], "MMMM")

Any help is appreciated as always.  Thanks!

 

Regards,

Derek

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jderekc,

 

Try this column:

 

Week = " Week " & 1 + WEEKNUM ( VendDisplay[DateCreated] ) – WEEKNUM ( STARTOFMONTH ( VendDisplay[DateCreated] ) ) & " - " FORMAT(VendDisplay[DateCreated], "MMM")

If not works, my recomendation is to use a Calendar table linked to VendDisplay[DateCreated], and then change VendDisplay[DateCreated] to Calendar[Date] in this formula.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @jderekc,

 

Try this column:

 

Week = " Week " & 1 + WEEKNUM ( VendDisplay[DateCreated] ) – WEEKNUM ( STARTOFMONTH ( VendDisplay[DateCreated] ) ) & " - " FORMAT(VendDisplay[DateCreated], "MMM")

If not works, my recomendation is to use a Calendar table linked to VendDisplay[DateCreated], and then change VendDisplay[DateCreated] to Calendar[Date] in this formula.

This is not a DAX! This is magic! Amazing!
Anonymous
Not applicable

@jderekc 

Can you please provide the solution here.

You are a genius, @Anonymous!  I did it and now my bar chart returns "Week 1 - Aug", "Week 2 - Aug", et cetera.  I did have to reformat the DAX formula just a little bit because it gave me an issue that completely failed its execution, but it was just a minor tweak.  Thanks so much!

 

Regards,

Derek

Anonymous
Not applicable

Its not working correctly...

https://1drv.ms/u/s!Aon2AsIzlG3tiyp74f_tQlYQaFbc

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.