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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
cwfmoore
Regular Visitor

Convert a [MONTH and [YEAR] column to a DATE.

Hi,

 

I have a csv document with a [MONTH] and [YEAR] column as shown. I would like to comine these two into a date column making it eg: 01/08/2022 for each entry.

 

Kindest regards.

cwfmoore_0-1666600067372.png

 

2 ACCEPTED SOLUTIONS
wdx223_Daniel
Super User
Super User

=Table.AddColumn(PreviousStepName,each Date.From(Text.Format("#[year]-#[month]-1",_)))

View solution in original post

Paste this portion in...

Date.From(Text.Format("#[year]-#[month]-1",_))

 

If this solves your problem, please accept @wdx223_Daniel's answer above as the solution. Not this one. 

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

View solution in original post

3 REPLIES 3
wdx223_Daniel
Super User
Super User

=Table.AddColumn(PreviousStepName,each Date.From(Text.Format("#[year]-#[month]-1",_)))

Forgive my amatuer-ish-ness but how would you complete that without the advanced editor?  In this interface?

 

cwfmoore_0-1666614479050.png

 

Paste this portion in...

Date.From(Text.Format("#[year]-#[month]-1",_))

 

If this solves your problem, please accept @wdx223_Daniel's answer above as the solution. Not this one. 

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors
Top Kudoed Authors