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

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.

Reply
RustyNails
Helper III
Helper III

Decrypting a SQL Server Column from Binary encryption during PBI Data Import

Hello. I have a SQL Server table with an encrypted Column that uses CEK_Auto1 Encryption key (deterministic). It converted the column into a Hex format (0x0126E595C47C89086...). In PowerBI I need to decrypt this column (my user should have been given the SQL privileges to do so). The Column's original datatype is nvarchar(100) but in reality it is just numbers being stored in nvarchar type.

 

In PBI the column shows up as "Binary". How do I Decrypt this column in PBI?

 

Thanks

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi RustyNails, 

According to yiur description, it seems that you want to convert binary to hex or text, right? If so, you could try below M code to see whether it work or not.

= Table.AddColumn(Source, "Custom", each Binary.ToText([a],BinaryEncoding.Base64))
or
= Table.AddColumn(#"Added Custom", "Custom.1", each Binary.ToText([a],BinaryEncoding.Hex))

 You could refer to Binary.ToText ,Converting Binary to hex value or numeric value  or this blog  for details.

Best Regards,
Zoe Zhi

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
dax
Community Support
Community Support

Hi RustyNails, 

According to yiur description, it seems that you want to convert binary to hex or text, right? If so, you could try below M code to see whether it work or not.

= Table.AddColumn(Source, "Custom", each Binary.ToText([a],BinaryEncoding.Base64))
or
= Table.AddColumn(#"Added Custom", "Custom.1", each Binary.ToText([a],BinaryEncoding.Hex))

 You could refer to Binary.ToText ,Converting Binary to hex value or numeric value  or this blog  for details.

Best Regards,
Zoe Zhi

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

 

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors