Forum Discussion
Convert data in 2 cells into date
- 5 years ago
Hi Fowmy,
For some reason i cannot share the screen shot here.
But yes its the same way you have it up there.
I need a result column to have (Jan-20 & Jan-19).
Thanks for your help.
- 5 years ago
vishwanathans
If you need a dax solution, go to your table in the model and under Home Tab, click on New Column and the following code, make sure you rename table and column names as per your table:Month Year = DATEVALUE("01-" & Period[month] & "-"& RIGHT(Period[year],2))
If you want to do it in Power Query then
Go to Power Query, create a new blank query and paste the below code on the advanced editor and check the step:let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8krMU9JRcos0MlCK1YlWcktNAnMNLZViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [month = _t, year = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"month", type text}, {"year", type text}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Date.From("01-" & [month] & "-" & Text.End([year],2) )), #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Custom", type date}}) in #"Changed Type1"
Thanks Fowmy it worked thank you.
Would it be possible to help me on this too. I know its much of a ask i am sorry.
Below is my data. This how the system output was.
I need to prep my data to this. I there any way that i can do it here.
vishwanathans
Glad it worked for you!,
Regarding the additional question, please create a new question and provide your sample source data in text format (not image), solutions are possible.