cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dmoney7612
Frequent Visitor

Creating date index

I have the below data showing company fiscal year and month number. My intention is to convert this data into a "month year" format. For instance, I need the 202006 to read as September 2020, 202007 as October 2020, and so on. I was told I needed to create an index, but wasn't sure the best way to go about it. I appreciate any insight, thanks!

 

dmoney7612_0-1613249828413.png

 

 

 

 

 

1 ACCEPTED SOLUTION
v-yuaj-msft
Community Support
Community Support

Hi @dmoney7612 ,

 

Based on your description, you can do some steps as follows.

1. Create a date column to record the real date from the "Fisal year month number".

_DATE = DATE(LEFT([Fisal Year Month Number],4),RIGHT([Fisal Year Month Number],2),1)

2. create a calculated column.

Test_for_date = 

var x1=DATEADD('Calendar'[_DATE],3,MONTH)

return

FORMAT(x1,"MMMM"&" "&"YYYY")
Result:

v-yuaj-msft_0-1614932582749.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

8 REPLIES 8
v-yuaj-msft
Community Support
Community Support

Hi @dmoney7612 ,

 

Based on your description, you can do some steps as follows.

1. Create a date column to record the real date from the "Fisal year month number".

_DATE = DATE(LEFT([Fisal Year Month Number],4),RIGHT([Fisal Year Month Number],2),1)

2. create a calculated column.

Test_for_date = 

var x1=DATEADD('Calendar'[_DATE],3,MONTH)

return

FORMAT(x1,"MMMM"&" "&"YYYY")
Result:

v-yuaj-msft_0-1614932582749.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

Shishir22
Resolver II
Resolver II

Hello @dmoney7612 ,

 

You can crete calculated column as

 

 

Column 2 = DATE(LEFT('Table'[Column],4),RIGHT('Table'[Column],2),01)

 

 

And change the format to mmmm yyyy from format option.

 

Shishir22_0-1613253259575.png

 

If this fulfilled your requirement please mark this post as a solution.

 

Thanks!

 

I tried this but it doesn't give me the correct order for my fiscal months. For example I need 202006 to be September 2020, but when I use this formula it shows 202006 as June 2020. Are there previous steps I need to complete first? 

Hello @dmoney7612 ,

 

Try this-

Column 2 = DATEADD(DATE(LEFT('Table'[Column],4),RIGHT('Table'[Column],2),01),3,MONTH)

 

Please check for 202012 and 202101 if its giving expected result.

 

If this fulfilled your requirement please mark this post as a solution.

 

Thanks!

I am receieving an error right after the ",01),"   

Use your original column 202006 as the Sort By column for the new column.  If that gives a circular dependency error, you will need to make the MMMM yyyy column in the query editor first.

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


mahoneypat
Super User IV
Super User IV

Please try this column expression

 

YM Name = FORMAT(DATE(left(YM[YearMonthIndex],4), RIGHT(YM[YearMonthIndex],2),1), "MMMM YYYY")
 
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


I'm confused as to what the "YM' in the forumla is referencing 

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors