Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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 ...
  • daXtreme's avatar
    4 years ago

    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.

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    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.

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hello Anonymous ,

     

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

    Thank you for replying.

     

    Regards,

    Saurav