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

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

Reply
Novice100
Frequent Visitor

HEX2BIN

Hello Community,

 

I have a hex value as : 29 6A CC 69 D1 6C 5C 1B

and want to convert it to binary as: 0010100101101010110011000110100111010001011011000101110000011011.

 

I did my research but couldn't find a direct way to convert it, so i tried to convert from HEC2DEC (provides approx value) and then DEC2BIN (getting error "An argument of function 'MOD' has the wrong data type or the result is too large or too small."). Please let me know is there any direct way or if I can make ay changes in the  below attached dax codes:

HEX2DEC:

h2d.PNG

DEC2BIN:

d2b.PNG

 

Thanks in advance,

Saurav

3 ACCEPTED SOLUTIONS
daXtreme
Solution Sage
Solution Sage

Why don't you convert all your hex values in Power Query or in the source? DAX is not the best place to do it and as you can already see: it's awkward, to say the least.

View solution in original post

Anonymous
Not applicable

Hi @Novice100 ,

 

By my research, I'm afraid that we cannot convert hex to Binary directly in power bi by DAX.

You'd better convert hex to number and then convert number to binary as a workaround.

Here are two thread you could refer to.

https://www.excelandpowerbi.com/?p=291

https://community.powerbi.com/t5/Desktop/Number-to-Binary/m-p/235261#M104739

https://xxlbi.com/blog/converting-hexadecimal-to-decimal-numbers-in-power-query/

 

Best Regards,
Rico Zhou

 

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

Hello @Anonymous ,

 

Yes I've already solved the problem by converting Hex2Dec and then Dec2Bin.

Thank you for replying.

 

Regards,

Saurav 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Novice100 ,

 

By my research, I'm afraid that we cannot convert hex to Binary directly in power bi by DAX.

You'd better convert hex to number and then convert number to binary as a workaround.

Here are two thread you could refer to.

https://www.excelandpowerbi.com/?p=291

https://community.powerbi.com/t5/Desktop/Number-to-Binary/m-p/235261#M104739

https://xxlbi.com/blog/converting-hexadecimal-to-decimal-numbers-in-power-query/

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @Anonymous ,

 

Yes I've already solved the problem by converting Hex2Dec and then Dec2Bin.

Thank you for replying.

 

Regards,

Saurav 

Anonymous
Not applicable

Hi @Novice100 ,

 

I am so glad that you could solve your problem. Please kindly Accept the helpful reply as the solution. More people will benefit from it. 

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

daXtreme
Solution Sage
Solution Sage

Why don't you convert all your hex values in Power Query or in the source? DAX is not the best place to do it and as you can already see: it's awkward, to say the least.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.