Converting HTTPs link images/icons to Base 64 in Power BI
If you have a column of images/icons in https links format like below:

Then you can convert it to base 64 URL format, which is the acceptable format by the xViz Performance Flow visual (as it is certified):

Steps to be followed in Transform Editor/Power Query:
Step 1: Create a Custom Function in your Power BI report -> Transform Data:
Home → New Source → Blank Query

Change the name of the query to Query1 to ImgtoBase64Url and Click on Advanced Editor

Paste the below code and Click on Done:
let
Source = (ImageUrl as text) as text =>
let
BinaryContent = Web.Contents(ImageUrl),
Base64 = "data:image/jpeg;base64, " & Binary.ToText(BinaryContent, BinaryEncoding.Base64)
in
Base64
in
Source
Note: The prefix of "data:image/jpeg;base64, " must be adjusted as per the image extension, i.e. replace the "jpeg" with the extension of the image that you are using (eg: png, etc.)
Step 2: Invoke the custom function in the data:
Add Column → Invoke Custom Function

Add the following details in the popup:
Provide a name for the new column
Select the function query name “ImgtoBase64Url”
Select the column with Images URL

Result: This will result in a new column named "Image" which will contain the Base 64 URLs. Use this column in the xViz Performance Flow visual.
Here is an example report file:
Last updated
Was this helpful?