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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Binary data stored in numeric values

I'm delving into the stats I can pull from our Active Directory.  Active Directory has a field called UserAccountControl, which stores its attributues in a value that PowerBI reads as a number.  The data contained is essentially binary data, although i cannot convert the field to Binary (set type as Binary) as it errors.

 

I'm hoping someone else might have worked with data like this before and might be able to point me towards the best method of identifying whether a certain attribute is set to True or False.

For example, for 1 record the value is coming up as 514.  This means that the attributes that represent the Binary value of 2 (2nd bit) and 512 (bit 10) have been set as true.  So if I wanted to check if the value of 2rd bit was enabled (the value of 2), i can see mathimatically that this is the case.  This example is fairly easy in this case, but seems pretty difficult when you start getting numbers with quite a few bit's turned on.

Surely there must be a fairly common method of checking bits that i can use in Power BI through either M or Dax.  Does anyone know a good method?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

To solve this problem i've made use of the functions mentioned in this thread:

http://community.powerbi.com/t5/Desktop/Number-to-Binary/td-p/235261

 

This has let me convert the Numeric Value back into Binary.  From here I create a new custom column and make use of Text.Start(Text.End([Column], X), 1), where X is the position from the right of the binary digit I care about.  This can be converted to True/False.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

To solve this problem i've made use of the functions mentioned in this thread:

http://community.powerbi.com/t5/Desktop/Number-to-Binary/td-p/235261

 

This has let me convert the Numeric Value back into Binary.  From here I create a new custom column and make use of Text.Start(Text.End([Column], X), 1), where X is the position from the right of the binary digit I care about.  This can be converted to True/False.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors
Top Kudoed Authors