Forum Discussion

RyanBrantley's avatar
RyanBrantley
Frequent Visitor
6 years ago
Solved

Azure Cost Management - Splitting Out Tags

I've connected PowerBI to our Azure tenant's cost management feed.  I'm wanting to split the various tag categories into their own columns.   I've done a few Google searches, and the handful of blo...
  • bfernandez's avatar
    bfernandez
    6 years ago

    Sorry about that, I was using it on some older code.

    Find the correct code here:

     

    application = 

    VAR tag = "application"

    VAR textLength =

    FIND( ",",

    Sheet3[Tags],

    FIND(tag,Sheet3[Tags])+LEN(tag)+3)-(FIND(tag,Sheet3[Tags])+LEN(tag)+3)-1

    RETURN

    MID(

    Sheet3[Tags],

    FIND(tag,Sheet3[Tags])+LEN(tag)+3,

    textLength)

     

    I have also added the Variable tag. Now, you simply have to get whatever tag you're looking for and replace "application" with the tag.

     

    This should solve your issue! Please mark this post as the solution to help others! 😁

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hey all,

     

    Not sure if anyone's still having trouble with this, but thought I'd share the method I used to work with tags.

     

    The Tags field in Azure Cost Management is almost JSON format, but is missing the opening and closing curly braces.

     

    By adding these back, I was then able to use Transform -> JSON without error.

     

    Example:

        #"Added Custom" = Table.AddColumn(usagedetails, "Tags JSON", each Text.Combine({"{ ", [Tags], " }"})),
        #"Parsed JSON" = Table.TransformColumns(#"Added Custom",{{"Tags JSON", Json.Document}}),

     

    Hope that helps someone!