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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Creating a Date from Source Name

Currently combining multiple excel docs with the date in the name of the excel file

 

eg: 2018 Capex Projects - February Forcast.xlsx

 

Would like to make a column that can be used to identify the date from the above example as 02/2018, is there a funtion that i can use that will help do this?

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@Anonymous,

Create the following columns in your table.

Month = if(search("january",[Source.Name],1,0)>0,01,if(search("february",[Source.Name],1,0)>0,02,if(search("march",[Source.Name],1,0)>0,03,if(search("april",[Source.Name],1,0)>0,04,if(search("may",[Source.Name],1,0)>0,05,if(search("june",[Source.Name],1,0)>0,06,if(search("july",[Source.Name],1,0)>0,07,if(search("august",[Source.Name],1,0)>0,08,if(search("september",[Source.Name],1,0)>0,09,if(search("october",[Source.Name],1,0)>0,10,if(search("november",[Source.Name],1,0)>0,11,if(search("December",[Source.Name],1,0)>0,12))))))))))))
Year = LEFT([Source.Name],4)
YearMonth = [Month]&"/"&[Year]

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
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

2 REPLIES 2
v-yuezhe-msft
Employee
Employee

@Anonymous,

Create the following columns in your table.

Month = if(search("january",[Source.Name],1,0)>0,01,if(search("february",[Source.Name],1,0)>0,02,if(search("march",[Source.Name],1,0)>0,03,if(search("april",[Source.Name],1,0)>0,04,if(search("may",[Source.Name],1,0)>0,05,if(search("june",[Source.Name],1,0)>0,06,if(search("july",[Source.Name],1,0)>0,07,if(search("august",[Source.Name],1,0)>0,08,if(search("september",[Source.Name],1,0)>0,09,if(search("october",[Source.Name],1,0)>0,10,if(search("november",[Source.Name],1,0)>0,11,if(search("December",[Source.Name],1,0)>0,12))))))))))))
Year = LEFT([Source.Name],4)
YearMonth = [Month]&"/"&[Year]

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

in excel, i know this might be a cluncky formula, but i would use something like this to identify the month:

 

if(isnumber(search("january",[Source.Name])),01,null)if(isnumber(search("february",[Source.Name])),02,if(isnumber(search("march",[Source.Name])),03,if(isnumber(search("april",[Source.Name])),04,if(isnumber(search("may",[Source.Name])),05,if(isnumber(search("june",[Source.Name])),06,if(isnumber(search("july",[Source.Name])),07,if(isnumber(search("august",[Source.Name])),08,if(isnumber(search("september",[Source.Name])),09,if(isnumber(search("october",[Source.Name])),10,if(isnumber(search("november",[Source.Name])),11,if(isnumber(search("december",[Source.Name])),12,NULL))

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors