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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
mediaware
New Member

Deducing the numbers from bitflag

Hi There,

 

Have a question that i've been trying to find a solution for but no luck so i hope someone here cld. provide a solution

 

Here goes:

 

I have a State colum with an integer that is made up of underlying bitflags

Thanks to the internet i've got a function that can give me the binary value of the integer.

e.g. 6 is 0000000110

My question is - how to get the 'binary value' as an array of or comma separated values

e,g. 6 is 2,4

 

Kind regards

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @mediaware ,

Here are the steps you can follow:

1. Create calculated column.

123 =
CONCATENATE(
    POWER(
    2,
    LEN('Table'[Column1])-
    FIND("1",[Column1])-1) ,
CONCATENATE(
    ",",
 POWER(2,
    (LEN('Table'[Column1])-
    FIND("1",[Column1])+1)-1
    )))

2. Result:

vyangliumsft_0-1663136077703.png

 

Best Regards,

Liu Yang

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-yangliu-msft
Community Support
Community Support

Hi  @mediaware ,

Here are the steps you can follow:

1. Create calculated column.

123 =
CONCATENATE(
    POWER(
    2,
    LEN('Table'[Column1])-
    FIND("1",[Column1])-1) ,
CONCATENATE(
    ",",
 POWER(2,
    (LEN('Table'[Column1])-
    FIND("1",[Column1])+1)-1
    )))

2. Result:

vyangliumsft_0-1663136077703.png

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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