cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cheid1977 Helper I
Helper I

How to show week number per month?

I need to show how much volume shipped the first, second, third, and fourth week of each month. How can you assign a number (1-4 or 5) to each week of the month?  Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Re: How to show week number per month?

Hi cheid1977,

 

Please take a try with the formula below in a calculated column:

weekinmonth = 1 + WEEKNUM ( 'Calenda'[Date] )-WEEKNUM( STARTOFMONTH ('Calenda'[Date]))

This formula would work with the month level, which should be no calculated errors.

 

Please reply back if you need any further assistance on this topic.

Regards

 

View solution in original post

6 REPLIES 6
Super User IV
Super User IV

Re: How to show week number per month?

Hard to say without your data or some sample data. I think the right way would be to add a custom column to your Date table.

 

 

 

 


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Super User IV
Super User IV

Re: How to show week number per month?

OK, I didn't fully test this, but the general concept should work, you may have to tweak.

 

These are all columns:

 

WeekN = WEEKNUM([Date])

MonthN = MONTH([Date]) 

Column 9 = IF([MonthN] = 1,1,([MonthN]-1)*4)

Column 5 = IF([Column 9]=1,1,[WeekN] - [Column 9] - 1)

---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Microsoft
Microsoft

Re: How to show week number per month?

Hi cheid1977,

 

Please take a try with the formula below in a calculated column:

weekinmonth = 1 + WEEKNUM ( 'Calenda'[Date] )-WEEKNUM( STARTOFMONTH ('Calenda'[Date]))

This formula would work with the month level, which should be no calculated errors.

 

Please reply back if you need any further assistance on this topic.

Regards

 

View solution in original post

efilipe Helper IV
Helper IV

Re: How to show week number per month?

This answer was very usefull to me! Thanks v-micsh-msft!

Juampe Helper I
Helper I

Re: How to show week number per month?

Thanks for the response but I have a problem I get Weekmonth in some cases from 1 to 6 . I was Expecting 1to 5 but i get even more possible values. Any idea?

pilargarzon
New Member

Re: How to show month number in my date hierarchy ?

i need add to my date hierarchy the number of month. i dont want show the name month( jan, feb, etc) 
, i want show the number month (1,2,3). Can you help me ?



 

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors