Forum Discussion
Converting from Text to Date
- 9 years ago
Do you have dedicated continuous calendar table in your data model which is best practice for time intelligence based reporting. If you dont have this table, you can create one, here is the link
Although see below on how to extract Month and Year and you need to sort this column by other column to get month order correctly.
Column 2 = FORMAT('Table'[Date], "MM/YY")Column = FORMAT('Table'[Date], "MMM/YY") - 9 years ago
You say you also want a column to be "what I need is - 9-2015 or even better sep-2015."
Add a column to your DATE table
Month = FORMAT('Dates'[Date],"mmm-YYYY")To get this sorted correctly also add the following column
MonthID = INT(format('Dates'[date],"YYYYMM")Once you have these two columns, Set your Month column to be sorted by your MonthID column.
- 9 years ago
Thanks, parry2k.
I used your second soultion and it works fine.
I'm not quiet sure I have understood your first solution. I did try to creatie this and got a message "The syntax for ';' is incorrect" I'm not sure why it occurs.
However, suppose I have managed to create the table and also have a 2'nd table with my impoted data that contains a date field,
Do you mean there should be some kind of join between them by the date fields (formated : dd/mm/yyyy) and than get the corresponding date format I'm intersted in ("mm/yyyy") from the date table.
Thanks again
Thanks, parry2k.
I used your second soultion and it works fine.
I'm not quiet sure I have understood your first solution. I did try to creatie this and got a message "The syntax for ';' is incorrect" I'm not sure why it occurs.
However, suppose I have managed to create the table and also have a 2'nd table with my impoted data that contains a date field,
Do you mean there should be some kind of join between them by the date fields (formated : dd/mm/yyyy) and than get the corresponding date format I'm intersted in ("mm/yyyy") from the date table.
Thanks again
"I'm not quiet sure I have understood your first solution. I did try to creatie this and got a message "The syntax for ';' is incorrect" I'm not sure why it occurs."
Try changing the ';' to ','
(Change the semicolon to a comma in all places)