Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a column that has mixed hexadecimal MEIDs (mobile equipment identifier - 14 characters) and decimal MEIDs (18 characters). I'd like to convert the hexadecimal MEIDs in the column to decimal and leave the decimal ones alone.
I used this formula in Excel to accomplish the task, but I can't get my DAX or Power Query attempts to work. Any help would be appreciated.
=IF(LEN(A2)=14,CONCATENATE(TEXT(HEX2DEC(LEFT(A2,8)),"0000000000"),TEXT(HEX2DEC(RIGHT(A2,6)),"00000000")),(A2))
*Red text denotes the Excel cells.
Solved! Go to Solution.
You may add a custom column as follows.
if Text.Length([Column1]) = 14 then Text.PadStart(Text.From(Expression.Evaluate("0x" & Text.Start([Column1], 8))), 10, "0") & Text.PadStart(Text.From(Expression.Evaluate("0x" & Text.End([Column1], 6))), 8, "0") else [Column1]
You may add a custom column as follows.
if Text.Length([Column1]) = 14 then Text.PadStart(Text.From(Expression.Evaluate("0x" & Text.Start([Column1], 8))), 10, "0") & Text.PadStart(Text.From(Expression.Evaluate("0x" & Text.End([Column1], 6))), 8, "0") else [Column1]
Thank you! Worked perfectly!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |