March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Ok I have a column in my data that has the year and month of an item captured.
The issue is that it is a text field that lists it as text in this format:
YYMM
I know I could split these and recombine them in the correct order and format it as date but that would take several steps.
Is there a more efficient way to perform this funtion?
Solved! Go to Solution.
Are all the years in the 2000s ?
you may have to modify the above if your column is only the last 2 year digits - YYMM
Column = DATE("20"&LEFT([Test],2), RIGHT([Test],2), 1)
If the column is called [Test] and if the format is YYYYMM, I generally do
= DATE(LEFT([Test],4), RIGHT([Test],2),1)
Careful about the year though. In your case, you only have YY instead of YYYY, so might have to concatenate 19 or 20 based on what you want.
Are all the years in the 2000s ?
you may have to modify the above if your column is only the last 2 year digits - YYMM
Column = DATE("20"&LEFT([Test],2), RIGHT([Test],2), 1)
Thanks this woked
Interesting I'm getting an error that the name date wasn't recognized?
Forgot to tell you, I did this in DAX (the modelling side) and not in M (query editor side)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |