Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Did you know you can put icons directly in your report's table? Well, it turns out you can! And here is how you do it.
Let's assume you have your icons ready to go, they have been uploaded to a server, no authentication needed, and they aren't going to change unless you update the report.
In the Power query editor, enter in two columns, one for "Icon Name" and another for "Icon Url". Fill in the data with your urls. Once you are finished Close and Load.
Start by adding a table or matrix visual with a column for "Icon Name".
Next, go to conditional formatting for the column and choose "Icons"
In the following menu, choose Format by: Field value. Then in Based on field, find your "Icon URL" in your data model.
Now behold: Icons in your table!
Let's say, your icons are stored in a place you need to authenticate in order to view them.
In this sample I will use Dev ops, but you are free to use any data source that produces images.
Start by loading the url of the image into your table. E.g. for dev ops you would:
let
Source = VSTS.Contents("https://dev.azure.com/<<<Your account>>>/<<<Your project>>>/_apis/wit/workitemtypes?" & apiVersion),
#"Imported JSON" = Json.Document(Source,65001),
value = #"Imported JSON"[value],
Custom1 = Table.FromRecords(value),
#"Removed Columns2" = Table.RemoveColumns(Custom1,{"url"}),
#"Expanded icon" = Table.ExpandRecordColumn(#"Removed Columns2", "icon", {"url"}, {"url"}),
#"Removed Columns" = Table.RemoveColumns(#"Expanded icon",{"referenceName", "description", "isDisabled", "xmlForm", "fields", "fieldInstances", "transitions", "states"})
in
#"Removed Columns"
Next you will need to download those images into Power Bi's data model.
#"Added Custom" = Table.AddColumn(#"Removed Columns", "Imagedata", each VSTS.Contents([url])),
Finally, and here is the fun part, you will ned to encode the image into a data url:
#"Invoked Custom Function" = Table.AddColumn(#"Added Custom", "encodeImage", each "data:image/svg+xml;base64," & Binary.ToText([Imagedata], BinaryEncoding.Base64)),
(replace : with : )
Note, you may need to change the image type to the appropiate type. Here it is "svg+xml", but you may want to use "png"
Next, simply follow the steps outlined in adding the icons to your table above, possibly adding a relationship to the table along with some additional columns, and you should end up with something that looks like:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.