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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
robinresilient
New Member

Base64 encoding for GUID

Hi i am looking for a way to encode a guid into base64

 

663e6ca3-31cd-4886-a90a-21a6ed8a => 

Zj5sozHNSIapCiGm7YqJbQ==

 

Tool: GUID Converter - Tool Slick

 

In code this would look like this:

$guid = "663e6ca3-31cd-4886-a90a-21a6ed8a"
$base64 = [system.convert]::ToBase64String(([GUID]($guid)).ToByteArray())
$base64
3 REPLIES 3
mahoneypat
Microsoft Employee
Microsoft Employee

Please see if the approach used in this article works for you.

Quick Tips: Converting Hexadecimal, Oct and Binary to Decimal in a Single Power Query Function (biin...

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


robinresilient
New Member

I tried the same - problem is it doesnt use the GUID as HEX value but just converts the string. Which result do you get.

lbendlin
Super User
Super User

Not sure where you got your result from but here's a Power Query version.

 

let
Source = Table.FromRows({{"663e6ca3-31cd-4886-a90a-21a6ed8a"}},{"GUID"}),
#"Added Custom" = Table.AddColumn(Source, "Base64", each Binary.ToText(Text.ToBinary([GUID],BinaryEncoding.Base64)))
in
#"Added Custom"

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.