Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi I've got some data as follows (in one column):
"third_party_funded": "Yes", "risk_score": 5.4, "tender_assurance_rating": "Amber/Green", "project_number": ["8675309", "771595", "107140"],...
It's comma delimited and in a later step I will be splitting each key value pair into columns however as you can see, there is a list in one of the KV pairs (Project Number), I would like to replace the commas in between the square brackets so that in my later step, they are not split.
Solved! Go to Solution.
@Anonymous
Please add the following custom column where I replace the "," with "|" within the [...]
let T=Text.BetweenDelimiters(_[Data], "[", "]") in Text.Replace( _[Data],T, Text.Replace(T,",","|" ))
Orginal Text:
|
Result:
Full Code:
Create a blank Query, go to the Advanced Editor, clear the existing code, and paste the codes give below and follow the steps.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("JcxBDsIgFATQqzR/bRRiEdudK89ggBCEr6KRNh9YeHtL2E1mXkYpKK9Iwa6Oys8+agoY5kHDDbOG3RYo5o/NfiHUMA9iP7ay4ObIupwrueTRkisxPZvQcPnekQ5XQkz9YqXljb7YVNvSkNJwPklxZFMXUnIxiZ45k3xkGgwY8wc=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Data = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Data", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each let T=Text.BetweenDelimiters(_[Data], "[", "]") in Text.Replace( _[Data],T, Text.Replace(T,",","|" )))
in
#"Added Custom"
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Anonymous
Please add the following custom column where I replace the "," with "|" within the [...]
let T=Text.BetweenDelimiters(_[Data], "[", "]") in Text.Replace( _[Data],T, Text.Replace(T,",","|" ))
Orginal Text:
|
Result:
Full Code:
Create a blank Query, go to the Advanced Editor, clear the existing code, and paste the codes give below and follow the steps.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("JcxBDsIgFATQqzR/bRRiEdudK89ggBCEr6KRNh9YeHtL2E1mXkYpKK9Iwa6Oys8+agoY5kHDDbOG3RYo5o/NfiHUMA9iP7ay4ObIupwrueTRkisxPZvQcPnekQ5XQkz9YqXljb7YVNvSkNJwPklxZFMXUnIxiZ45k3xkGgwY8wc=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Data = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Data", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each let T=Text.BetweenDelimiters(_[Data], "[", "]") in Text.Replace( _[Data],T, Text.Replace(T,",","|" )))
in
#"Added Custom"
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
You absolute legend!
Thanks that worked perfectly!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
8 | |
6 | |
6 | |
6 | |
5 |