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

How to convert 2018Q2 to date format?

I'm trying to convert a column with values listed like "2017Q3" to a date format.  Any ideas?  I'm trying to do YoY growth comparison and need a date column. 

4 REPLIES 4
Highlighted
rajendran Super Contributor
Super Contributor

Re: How to convert 2018Q2 to date format?

Hi

Try this

NewDate = CONCATENATE(LEFT(Test[Column1],4) ,
                               SWITCH( RIGHT(Test[Column1],2),
                                         "Q1","0101",
                                         "Q2","0401",
                                         "Q3","0701",
                                         "Q4","1001"))

Thanks
Raj

 

Community Support Team
Community Support Team

Re: How to convert 2018Q2 to date format?

Hi @agaidano,

 

Have you solved your problem?

 

If you have solved please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, you could try the formula below.

 

Baseon the formula from rajendran, you could create another column with the formula:

 

Column = DATE(LEFT('Test'[NewDate],4),MID('Test'[NewDate],5,2),RIGHT('Test'[NewDate],2))

Here is the output.

 

Capture.PNG

 

In addition, you could have a good reference of this similar thread which solved with M query.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
agaidano Frequent Visitor
Frequent Visitor

Re: How to convert 2018Q2 to date format?

Hi @v-piga-msft thank you for your replies!  I believe I am close here.  Only problem I am having is I am getting the error, "Cannot Convert Value " of type Text to type Integer".  Any Idea what I might be doing wrong here?  I have copied and pasted the formula's in exactly, substituting my correct column name, and I get this data type error.

 

Any thoughts?

 

Thank you very much. 

 

 

Community Support Team
Community Support Team

Re: How to convert 2018Q2 to date format?

Hi @agaidano,

 

Could you share the screenshots about your formula and the error message, so that we can help further investigate on it?

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 45 members 949 guests
Please welcome our newest community members: