Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
cgeorgeot
Frequent Visitor

Column transformation

Hello,

 

I need help to transform a column who contains a long string to (different length) into a multiple columns. (split the string)

 

The string located in the column nammed "Tags":

"owner":"cedric","location":"france","env":"prod",.......

 

I want to transform this string with this result:

 

Column 1 : Owner | Value : Cedric
Column 2 : Location | Value : France
Column 3 : env| Value : prod

 

Many thanks for your help

1 ACCEPTED SOLUTION

Hello

 

Thanks for your answer. I found a solution today:

 

let

    Source = AzureCostManagement.Tables("Enrollment Number", "xxxxx", 8, []),

    usagedetails = Source{[Key="usagedetails"]}[Data],

 

 

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

    #"Parsed JSON" = Table.TransformColumns(#"Added Custom",{{"Tags JSON", Json.Document}}),

    #"Tags JSON développé" = Table.ExpandRecordColumn(#"Parsed JSON", "Tags JSON", {"CMDB", "Contact", "Environment"}, {"Tags JSON.CMDB", "Tags JSON.Contact", "Tags JSON.Environment"})

  

 

in

 #"Tags JSON développé"

View solution in original post

23 REPLIES 23

Just replace nulls in [Tags] ...

 

Table.TransformColumns(usagedetails,{{"Tags", each if _ = null then "" else _, type text}})




Spyros Mavroforos

Data Consultant


Find me on LinkedIn or drop me an email

eSpyros

Hello

 

Thanks for your answer. I found a solution today:

 

let

    Source = AzureCostManagement.Tables("Enrollment Number", "xxxxx", 8, []),

    usagedetails = Source{[Key="usagedetails"]}[Data],

 

 

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

    #"Parsed JSON" = Table.TransformColumns(#"Added Custom",{{"Tags JSON", Json.Document}}),

    #"Tags JSON développé" = Table.ExpandRecordColumn(#"Parsed JSON", "Tags JSON", {"CMDB", "Contact", "Environment"}, {"Tags JSON.CMDB", "Tags JSON.Contact", "Tags JSON.Environment"})

  

 

in

 #"Tags JSON développé"

Anonymous
Not applicable

I know (now) what is your request.

what I don't know is

which code, of the many received, did you use?
where does it give you error?
can you show the error screen?

 

hint:

try the code using a table with few rows, change the contents wich you can't expose and let we know what appens.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.