Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
jayblog
Frequent Visitor

Convert mixed column Hexadecimal to Decimal in DAX or Power Query

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.

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@jayblog,

 

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]
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@jayblog,

 

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]
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you! Worked perfectly!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.