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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
J_Mug
Helper I
Helper I

Decrypt string values (AES256) from a column of a table in a query

HI,


I want to decrypt string values from a crypted column on a table imported as a query in my Power BI report. The string is crypted in AES256.

 

How can I do in Power Query to decrypt in a new column the content of this crypted column for each row of my query ? (dataset).

 

Thank in advance,

5 REPLIES 5
Nadjia
New Member

Hello, 
i am currently facing the same issue and i was wondering how have you delt with it last time to decrypt your query ?

Thanks in advance,

AlexisOlson
Super User
Super User

Where do you get the secret encryption key from in your scenario?

We receive it from our IT team, the string that contains the information is embedded in QR codes in tickets from third-party POS terminals in our stores, where it travels to a survey page where the client gives his response and we record the metadata from the transaction, it stays encrypted because the survey software can't decrypt.

 

This AES256 encryption is necessary because this data will be public in the ticket QR code and we don't want that metadata to be easily obtained by third parties.

 

We also thought about having a key in the survey and then connecting to the transactional system, but it was encrypted too, and we would need to decrypt anyway.

 

Therefore we need to decrypt after the metadata has passed through the survey software to have more information on that transaction.

 

I hope this helps.

I don't think there's a native implementation for AES256 in Power Query.

 

This leaves a few options:

  1. Decrypt before loading into Power BI (e.g. with SQL).
    • This is probably the simplest approach.
  2. Use a Python or R script within Power Query.
    • Both of these languages should have packages/libraries for AES.
  3. Write your own decryption implementation in M (or hire someone else to).
    • Possible but not really advisable. I've done this sort of thing with SHA256 but wouldn't feel comfortable using my own implementation for production purposes.

Hello how can we use Python since Power bi service do not support the Crypto library as for R  digest library isn't working correctly for my case 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.