Decode URI in Power Query with custom Uri.UnescapeDataString function

When working with cloud data sources you might encounter links where spaces show up as “%20” instead for example. This is called URI escaping or encoding. In Power Query there is a native function that does this kind of encoding: Uri.EscapeDataString – PowerQuery M | Microsoft Learn
However, a native function that does just the opposite is missing. Fortunately, this can be achieved with a custom function that I have found in the Power BI forum:

Uri.UnescapeDataString

https://gist.github.com/ImkeF/1c8ac8c4dfbf74f354e4f52496f03430

I hope it helps you as it did me.

Enjoy and stay queryious 😉

3 thoughts on “Decode URI in Power Query with custom Uri.UnescapeDataString function”

Leave a comment