βœ… How to Analyze Azure Costs Using Tags in Exported Billing Data

Azure tags help categorize cloud spend across departments, environments, applications, and more. When included in your exported billing data, tags can power deep analysis for budgeting, chargeback, or showback purposes.


🧾 1. Understand Tag Format in Exports

Tag data appears in the Tags column of your exported cost CSV:

Account TypeFormat
MCA / Pay-As-You-GoJSON string (e.g. {"Environment":"Prod","Dept":"Finance"})
EAMay be JSON or semicolon-delimited (e.g. Environment:Prod;Dept:Finance)

βœ… Tip: Check the structure in a sample file before proceeding.


πŸ› οΈ 2. Parse Tags into Columns

In Power BI (Power Query):

  • If the Tags column is JSON:
    1. Select the column > go to Transform > JSON > Parse.
    2. Use Json.Document([Tags]) in a Custom Column.
    3. Expand the resulting record into new columns like Environment, Dept, etc.
  • If tags are in key:value;key:value format:
    • Use Split Column by Delimiter, then parse each pair manually.

In Synapse / SQL:

  • If the column is JSON: sqlCopyEditJSON_VALUE([Tags], '$.Environment') AS Environment
  • For multiple tags, use OPENJSON to flatten into rows and pivot as needed.

πŸ“Š 3. Analyze by Tags

πŸ“ Filter by Tag

  • Power BI: Add a Slicer using the parsed tag column (e.g., Dept or Environment).
  • Azure Portal: Use Cost Management > Cost Analysis, then filter by tag key/value.

πŸ“ˆ Group by Tag

  • Power BI / Excel:
    • Use tag columns in visuals:
      • Pie chart: Cost by Application
      • Bar chart: Monthly cost by Environment
  • Azure Portal:
    • Use Group by Tag: [key] from the dropdown in Cost Analysis.

🧱 4. Handle Missing or Incomplete Tags

  • Resources without tags will show blanks in the Tags field.
  • Tags are captured at the time of cost generationβ€”changes are not retroactive.
  • Consider enabling tag inheritance (e.g., inherit from Resource Group) for untagged resources.

🧩 5. Multi-Tag Analysis

  • Combine multiple tags in reports:
    • Use two slicers (e.g., Project + Environment).
    • Or create a composite field (e.g., Project - Environment).
  • Model tags as columns for simplicity, or as a separate table for flexibility.

πŸ§ͺ 6. Troubleshooting Missing Tags

  • Confirm you’re using the latest export schema.
  • Make sure tags were present during the billing period.
  • Azure supports up to 50 tags per resourceβ€”all should export unless restricted by format or API version.

βœ… Summary

TaskToolMethod
Parse tagsPower BIJson.Document([Tags]) and expand
Query tagsSQL / SynapseJSON_VALUE() or OPENJSON
Filter/group by tagPower BI, Excel, PortalUse tag columns in visuals or slicers
Handle untagged resourcesAzure SettingsEnable tag inheritance from Resource Group

By parsing and using tags in your cost data, you can break down cloud spend by any business dimensionβ€”projects, teams, environments, owners, or cost centersβ€”unlocking powerful FinOps insights.