Forum Discussion

lkshck's avatar
lkshck
Helper III
4 years ago
Solved

Azure Cost Management - Tags into two columns (TagName, TagValue)

Hey,

I connected PowerBI to Azure Cost Management and I would like to split the current JSON structure into two columns which should contain TagName and TagValue. Currently I did it via the following tutorial and it works quite fine but I want to have just two columns at the end. So the solution should look like the following.

https://www.linkedin.com/pulse/convert-azure-tags-cost-reporting-power-bi-fix-anders-keis-hansen-

TagNameTagValue
environmentprod
environmentstaging
CostCenter111111
  • Hi, lkshck 

    I don't think you need to have the column like = "{"&[Tags]&"}".

    You can try splitting column values as follows:

    1.Split selected column into multiple rows by delimiter 'Comma'

    2.Split selected column into columns by delimiter 'Colon'

    3.Replace quotation marks with empty values

     

    Best Regards,
    Community Support Team _ Eason

3 Replies

  • v-easonf-msft's avatar
    v-easonf-msft
    Community Support

    Hi, lkshck 

    What roughly does your current JSON structure look like? Have you tried splitting column values according to some rules?

     

    Best Regards,
    Community Support Team _ Eason

  • So normal data structure of the Tags column looks like the following:

    I want to split this structure into two Columns, TagName and TagValue. So the TagName column should contain every value before the ":" and TagValue the value after ":". 

    Hope this is more clear.

    • v-easonf-msft's avatar
      v-easonf-msft
      Community Support

      Hi, lkshck 

      I don't think you need to have the column like = "{"&[Tags]&"}".

      You can try splitting column values as follows:

      1.Split selected column into multiple rows by delimiter 'Comma'

      2.Split selected column into columns by delimiter 'Colon'

      3.Replace quotation marks with empty values

       

      Best Regards,
      Community Support Team _ Eason