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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
i820017
Resolver II
Resolver II

Date to YearMonth Column

I am trying to create a column that takes a date in mm/dd/yyyy and turns it into YearMonth. (The name of the column that I am working with is 'Procedure Request Form'[Date Request Submitted])

 

For example:

09/14/2001

10/15/2002

11/16/2003

 

will become

200109

200210

200311

 

 

I have tried using LEFT and RIGHT, but it doesn't work

 

 

1 ACCEPTED SOLUTION

oh....!!! This should work now. 🙂

Column = IF(ISBLANK('Table'[Column1]),BLANK(),FORMAT(DATEVALUE('Table'[Column1]),"YYYYMM"))

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

9 REPLIES 9
Samarth_18
Community Champion
Community Champion

Hi @i820017 ,

 

Please try below:-

Column = FORMAT(DATEVALUE('Table'[Column1]),"YYYYMM")

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

I used DATEVALUE, and I still get an error.

 

i820017_0-1650392389974.png

 

@i820017 Please try this:-

Column = 
var result = FORMAT(DATEVALUE('Table'[Column1]),"YYYYMM")
return IF(ISBLANK(result),BLANK(),result)

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

I justs did that, and I am still getting the same error.

 

i820017_0-1650393022951.png

 

oh....!!! This should work now. 🙂

Column = IF(ISBLANK('Table'[Column1]),BLANK(),FORMAT(DATEVALUE('Table'[Column1]),"YYYYMM"))

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

This worked...thanks!!

i820017
Resolver II
Resolver II

I am still getting an error.

 

i820017_0-1650390740049.png

 

 

This is weird because Date Request Submitted is a Date as seen below.

i820017_1-1650390904426.png

 

tackytechtom
Most Valuable Professional
Most Valuable Professional

Hi @i820017 ,

 

How about this:

YearMonth = 
FORMAT ( Table[Date], "YYYYMM" )

 

Does this solve your issue? 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Anonymous
Not applicable

Hi @i820017 

You can create a column this way, Column = FORMAT ([Date Request Submitted], "YYYYMM" )

And you will get the desired result.

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.