Forum Discussion
Azure Cost Management - Splitting Out Tags
- 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! 😁
- Anonymous6 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!
Hi I have tried, but not sucessfull. I want my one big tags to be splitted into multiple columns with thir data in rows without impacting cost numbers /other columns.
Currently its in this look :-
"Environment": "AAA","ExpenditureClassification": "BBBB","CostType": "CCCC","OrganizationUnit": "DDDDD","TraversalComponent": "EEEE","System": "NotAssignedYet",Product": "NotAssignedYet","ProductCategory": "NotAssignedYet","BusinessUnit": "NotAssignedYet","ProjectCode": "NotAssignedYet","Customer": "LLLLL","DepartmentOwner": "EEEE","ImplementationDepartment": "KKKKK","ImplementationTeam": "PPPPPP","DataClassification": "DDDDD","BusinessCategory": "HHHHH","LegacyInfrastructure": "YYYYY"
======
I am trying to get this look :- where Environment, ExpenditureClassification etc are columns
"Environment": "AAA",
"ExpenditureClassification": "BBBB",
"CostType": "CCCC",
"OrganizationUnit": "DDDDD",
"TraversalComponent": "EEEE",
"System": "NotAssignedYet",
"Product": "NotAssignedYet",
"ProductCategory": "NotAssignedYet",
"BusinessUnit": "NotAssignedYet",
"ProjectCode": "NotAssignedYet",
"Customer": "LLLLL",
"DepartmentOwner": "EEEE",
"ImplementationDepartment": "KKKKK",
"ImplementationTeam": "PPPPPP",
"DataClassification": "DDDDD",
"BusinessCategory": "HHHHH",
"LegacyInfrastructure": "YYYYY"
I found a way that works for me and may work for you. You can create a new column in your table and add the following code that is below. The code will be used to set the name of your new colum eg CostCentre and then search the tags table for anything that matches your search criteria around costcentre and add those values to the new table. You can use this over and over by changing out CostCenre in the search section for any tag key you are searching for. One new column for each tag key.