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.
I need to format some part numbers in Power Query but can't figure out how to do it in an automated way.
This is what the raw data looks like:
This is how I need it to look:
Someone told me this could be done with JSON but I wasn't hoping something else might work before I go to that.
Thank you
Solved! Go to Solution.
use 'split column by delimiter' and (in the advanced section) choose 'To rows'.
After that, you can Merge the columns.
Hi @khat,
let
SampleSource = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnRyNjQyNjFV0lEytDa1tlCK1YlWcvfwMje1sASKWVhbWhuaggV9/fxNjUzMQAoNrA2NrM2UYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
Split = Table.TransformColumns(SampleSource, {{"Column2", each Text.Split(_, ";")}}),
ExpandedSplit = Table.ExpandListColumn(Split, "Column2"),
MergedColumns = Table.CombineColumns(ExpandedSplit,{"Column1", "Column2"},Combiner.CombineTextByDelimiter("-", QuoteStyle.None),"Merged")
in
MergedColumns
If you want to refer your data, delete this part and refer to your table (or previous step). Don't forget comma.
let
Source = your_raw_table,
rows = Table.ToRows(Source),
to_list = List.TransformMany(
rows,
(x) => Text.Split(x{1}, ";"),
(x, y) => {x{0} & "-" & y}
),
to_tbl = #table({"desired format"}, to_list)
in
to_tbl
Dumb question here: do I create a new column and put the suggested code in there? Unsure of the first step.
use 'split column by delimiter' and (in the advanced section) choose 'To rows'.
After that, you can Merge the columns.
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 |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |