Convert Azure tags in Power BI

If you are using Power BI and pulling data from Azure Cost Management you will most likely want to extract data from tags created within Azure. This isn't as easy as it seems.

Assuming you are familiar with Power BI and have imported data from Azure Cost Management - here are the steps to making them usable;

  1. Edit the query for the data set that contains the tags such as 'Usage details'.

Edit Query

  1. Add a Custom Column to the dataset.

Add Custom Column

  1. Give the column a name and add { and } around the Tags column for the formula as shown in the diagram below (this is to make it a proper JSON type).

Custom Column Formula

  1. Find the new custom column, right click the column header and select Transform and then JSON.

Transform to JSON

  1. Expand the JSON records now in the column to select the tags.

Expand Records

  1. Select the tags you want to be able to use and click OK. Note this takes a while to load and may not load all possible values, if this is the case click on the 'Load more' link.

Select Tags

  1. The selected tags appear as new columns in the dataset, with the column name the tag key and the tag values as the column values.

New Columns

  1. Close and apply the changes to the dataset. Once done the dataset fully reloads which may take a while.

Close and Apply

  1. The columns are now usable columns within the dataset.

Usable Columns