Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hey Guys,
I have a set of data for training and I reach the point where I pivot the data properly yet, when I try to change the data type from text to date format (by changing type or using the date from text function it always returns error)
any Idea how to fix this ??
Solved! Go to Solution.
Date.From(Text.Combine(Splitter.SplitTextByAnyDelimiter({"st ","nd ","rd ","th "})([Attribute]),"-"))
Date.From(Text.Combine(Splitter.SplitTextByAnyDelimiter({"st ","nd ","rd ","th "})([Attribute]),"-"))
Worked like magic
don't wanna bother, but can u tell me what was I doing wrong and how u wrote this formula, I'm a newbie in M
text with "st ","nd ","rd ","th " can not be recognized as a date, so you must replace them with "-".
Hi, @Anonymous ;
You could try it.
1.replace "," to ""
2.add custom column.
Date.FromText(
Text.Middle(Text.SplitAny([Hours], " "){0},0,
Text.Length(Text.SplitAny([Hours], " "){0})-2)
& "-"&Text.SplitAny([Hours], " "){1}
& "-"&Text.SplitAny([Hours], " "){2})
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You need to remove the ordinal suffixes.
Something like:
#"Convert to Date" = Table.TransformColumns(#"Previous Step", {
"Attribute", each Date.From(List.Min(List.Accumulate({"st","nd","rd","th"},{}, (state, current)=>
state & {Text.Replace(_,current,"")}))), type date
})
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
8 | |
7 | |
6 |