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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
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:
DEC2BIN:
Thanks in advance,
Saurav
Solved! Go to Solution.
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.
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
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
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.
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.