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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
vjnvinod
Impactful Individual
Impactful Individual

Incorrect Month

 

I am seeing some issues with my calendar table

Week5 is technically should be P01, but its shown as P02

 

this is the formula I am using for month number

MonthNumber =
MONTH ( 'Date'[Date] )
 
The last week of July should be always July month number, in this case, it comes as 7 & 8, as a result, my Fiscal month number is incorrect
 
How do I fix the below formula?
 
MonthNumber =
MONTH ( 'Date'[Date] )
so that the last week of any month should be same number of that month

 

vjnvinod_0-1644158231760.png

 

8 REPLIES 8
v-yalanwu-msft
Community Support
Community Support

Hi,  @vjnvinod ;

Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we could close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yalanwu-msft 

 

i managed to get this resolved by using

Month number and week start date combination

v-yalanwu-msft
Community Support
Community Support

Hi, @vjnvinod ;

You could try it.

MonthNumber =
MONTH ( 'Date'[Week End] )

 

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mahoneypat
Microsoft Employee
Microsoft Employee

Please see if this calendar table is useful.

445 Calendar with 53-Week Years – Hoosier BI

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


vjnvinod
Impactful Individual
Impactful Individual

@mahoneypat 

 

544 with the 52-week calendar is what I am trying to build?

Do you have a sample pbix you have handy to use?

Are you comfortable adapting the M code from that article to meet your needs? It shouldn't take much I think.

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


vjnvinod
Impactful Individual
Impactful Individual

@mahoneypat 

I can try, but what happens to those M Code next year? will that work?

Not sure what you mean, but a simpler solution might be to add a column with this expression to your existing Date table query. You can adapt if you week starts on a different day, but this will calculate the fiscal month based on the month of the first day of that week.

 

= Date.Month(Date.StartOfWeek([Date], Day.Sunday))

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors