The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi All,
Wondering if anyone can help me with the error. I am trying to write a if statement that will output the what is already shown, while the fixing the european formatted date. Pleae see below for the data set, the outcome, and the function. I must be missing something, if anyone can help that would be awesome.
Thanks in advance.
Solved! Go to Solution.
The 'Any' datatype isn't a particularly useful one if you can avoid it.
I suspect there's an implicit conversion to date going on for some of the values that have double figures for day but it can't convert the single figure days.
If you can get the column in text format first (quite early in the Steps) (and maybe pad the start for single figure days) you'll have a better chance.
I think you might have to look at the 2nd 'if' clause (it's different than the first) also.
And it might have been better if you had provided the DateStarted column and type since that's the one that's in the formula.
Insert ths statement
= Table.AddColumn(Source, "Custom", each if Text.Contains([DateStarted],"/") then Date.From([DateStarted]) else if Text.Contains([DateStarted],"-") then #date(Number.From(Text.Split([DateStarted],"-"){2}),Number.From(Text.Split([DateStarted],"-"){1}),Number.From(Text.Split([DateStarted],"-"){0}))
else null, type date)
Thanks, but the statement didn't work for me.
The 'Any' datatype isn't a particularly useful one if you can avoid it.
I suspect there's an implicit conversion to date going on for some of the values that have double figures for day but it can't convert the single figure days.
If you can get the column in text format first (quite early in the Steps) (and maybe pad the start for single figure days) you'll have a better chance.
I think you might have to look at the 2nd 'if' clause (it's different than the first) also.
And it might have been better if you had provided the DateStarted column and type since that's the one that's in the formula.
Thank you, adding the extra step to make the column text works. For some reason it didn't work, maybe I was doing something wrong.
Sorry about the screen shot, I made a copy of it, so I could put it in a screen shot together.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.