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
Anonymous
Not applicable

Custom Date Table - Same Month Returning as 2 Month Numbers

Hello everyone!

 

I created a custom Date Table for our Fiscal Year where February = Month 1 and built my custom columns from this. It seemed to be working fine, however, I tried to recreate custom column, but it defaults 2/1/2020 to Month 1 and 2/2/2020 to Month 2.  I tried to recreate the issue on the table where the month numbers are correctly pulling and the same thing happens. Help!

 

Base Table: 

rtqjordan_0-1619961950903.png

Month Number:

rtqjordan_1-1619962008555.png

 

Correct Columns:

rtqjordan_2-1619962129651.png

 

2/1/2020 recognized as Month 1 and 2/2/2020 as Month 2

rtqjordan_3-1619962162189.png

 

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@Anonymous 

Same issue happened to me with month(), you may used the following column instead.

 

Column = IF(([Date].[MonthNo])=1,12,([Date].[MonthNo])-1)
 
V-pazhen-msft_0-1620179037549.png


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
V-pazhen-msft
Community Support
Community Support

@Anonymous 

Same issue happened to me with month(), you may used the following column instead.

 

Column = IF(([Date].[MonthNo])=1,12,([Date].[MonthNo])-1)
 
V-pazhen-msft_0-1620179037549.png


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

Fowmy
Super User
Super User

@Anonymous 

Create your month number column using the following code and try:

 Month Number =  MONTH(EOMONTH([Date],-1))



 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thank you!

Anonymous
Not applicable

You could do a switch or nested if statement 

 

so if month from date is February then 2 if month from date is March then 3 etc. 

 

last thing is make a calendar in excel based on what you want and then query it in. 

Anonymous
Not applicable

Thanks! My issue is it worked in the past, so not sure why it stopped working.

Anonymous
Not applicable

Oh ok I wonder If the format of the date column changed. Have you tried adjusting it in column settings? that might of caused the issue if it worked previously. 

Anonymous
Not applicable

Nothing has changed... in fact when I tried to recreate the month number column on the same table with the correct month numbers, I get the same issue. Thanks for replying!

Anonymous
Not applicable

Hey @Anonymous 

this one is weird i opened up my laptop duplicated your query and then couldn't get the same issue.  i get the corrected result.   not sure what is happening in you report.  any chance you could send a copy to see what is happening? 

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.