Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I have a mix of both US and UK dates in the same column. I need to figure out how to get them all into the US format. When I try to change the type to US, all of the UK dates show up as "error". Here is a screenshot of the column I am trying to fix. My US dates have the format MM/DD/YYYY, my UK have the format DD-MM-YYYY (i.e. slashes for US and hyphens for UK). Need some help with this one.
Solved! Go to Solution.
Hi,
I tried to create a sample pbix file like the attached file.
Please check the below attached pbix file and the code that is used in Power Query Editor.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjTSN9Q3MjAyUorViVYyNtQ1MNSFc03wyBmZonANLVG5hrooPGSDUEw1MkfoiwUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Date of SW" = _t]),
Custom1 = Table.AddColumn(Source, "Result column", each if Text.Contains([Date of SW],"/") then
"en-US" else
"en-GB"),
#"Added Index" = Table.AddIndexColumn(Custom1, "Index", 1, 1, Int64.Type),
#"Pivoted Column" = Table.Pivot(#"Added Index", List.Distinct(#"Added Index"[#"Result column"]), "Result column", "Date of SW"),
#"Changed Type with Locale" = Table.TransformColumnTypes(#"Pivoted Column", {{"en-US", type date}}, "en-US"),
#"Changed Type with Locale1" = Table.TransformColumnTypes(#"Changed Type with Locale", {{"en-GB", type date}}, "en-GB"),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type with Locale1", {"Index"}, "Attribute", "Result"),
#"Removed Other Columns" = Table.SelectColumns(#"Unpivoted Other Columns",{"Result"})
in
#"Removed Other Columns"
Hi,
I tried to create a sample pbix file like the attached file.
Please check the below attached pbix file and the code that is used in Power Query Editor.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjTSN9Q3MjAyUorViVYyNtQ1MNSFc03wyBmZonANLVG5hrooPGSDUEw1MkfoiwUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Date of SW" = _t]),
Custom1 = Table.AddColumn(Source, "Result column", each if Text.Contains([Date of SW],"/") then
"en-US" else
"en-GB"),
#"Added Index" = Table.AddIndexColumn(Custom1, "Index", 1, 1, Int64.Type),
#"Pivoted Column" = Table.Pivot(#"Added Index", List.Distinct(#"Added Index"[#"Result column"]), "Result column", "Date of SW"),
#"Changed Type with Locale" = Table.TransformColumnTypes(#"Pivoted Column", {{"en-US", type date}}, "en-US"),
#"Changed Type with Locale1" = Table.TransformColumnTypes(#"Changed Type with Locale", {{"en-GB", type date}}, "en-GB"),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type with Locale1", {"Index"}, "Attribute", "Result"),
#"Removed Other Columns" = Table.SelectColumns(#"Unpivoted Other Columns",{"Result"})
in
#"Removed Other Columns"
Worked perfectly. Thank you so much!!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 23 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |