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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Hex to Binary conversion (helping function provided from another post)

I am receiving data for the operation of some sensors which is in Hex format. 

In order to see which sensor is on and which is off, I need to convert this into Binary, thus know which sensors are on or off.

 

example: I get 

0xc00000200
0x1000000
0x400000
0x500000000

0x400040000

0x0

 

Each row of the Hex after 0x at full length must be of 12 characters, so:

0x0 = 0x000000000000 

0x400040000 = 0x000400040000

etc...

the binary results should be of length something like:

0000 0000 0000 1010 0000 0000 0000 0000 0001 0000 0000 0000

 

where each character of the binary represents a sensor.

 

Question: When the HEX  is converted to Binary like above. How am i going to define the name of each of the character in the binary? 

 

so if 0000 0000 0000 1010 ......  I would be able to reverse it and give each of the binary character a name like B1, B2, B3 ... B48.

 

I was hoping someone with good coding knowledge could make this Hex to Decimal function to Hex to Binary instead, in addition of the above requirements. 

 

 

Hope someone has a good solution to this, thanks Smiley Happy

@Greg_Deckler 

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

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

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

Best  Regards,

Cherry

 

 

Community Support Team _ Cherry Gao
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

1 REPLY 1
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

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

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

Best  Regards,

Cherry

 

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.