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
agaidano
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
v-piga-msft
Resident Rockstar
Resident Rockstar

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.

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. 

 

 

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

Hi

Try this

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

Thanks
Raj

 

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.