Forum Discussion
prashantg364
3 years agoHelper II
power BI query editor
I am having a table as shown below.
I want to add one new row after each row & a new column with band information as shown at the end. Pls help
input table
| Zone | Cluster | % Completion |
| BR | BR-MZPR | 92% |
| BR | BR-PTNA | 95% |
| BR | BR-GAYA | 91% |
| BR | BR-PTNAK | 98% |
| BR | BR-GAYAL | 92% |
| BR | BR-PTNAM | 92% |
| BR | BR-PURN | 90% |
| BR | BR-MKMH | 95% |
| BR | BR-MZPRD | 96% |
Ouput table required
| Zone | Cluster | % Completion | Band |
| BR | BR-MZPR | 92% | 1 |
| BR | BR-MZPR | 92% | 2 |
| BR | BR-PTNA | 95% | 1 |
| BR | BR-PTNA | 95% | 2 |
| BR | BR-GAYA | 91% | 1 |
| BR | BR-GAYA | 91% | 2 |
| BR | BR-PTNAK | 98% | 1 |
| BR | BR-PTNAK | 98% | 2 |
| BR | BR-GAYAL | 92% | 1 |
| BR | BR-GAYAL | 92% | 2 |
| BR | BR-PTNAM | 92% | 1 |
| BR | BR-PTNAM | 92% | 2 |
| BR | BR-PURN | 90% | 1 |
| BR | BR-PURN | 90% | 2 |
| BR | BR-MKMH | 95% | 1 |
| BR | BR-MKMH | 95% | 2 |
| BR | BR-MZPRD | 96% | 1 |
| BR | BR-MZPRD | 96% | 2 |
1 Reply
- ThxAlotSuper User
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcgpS0gESur5RASCWpZGqUqwOQjggxM8RJGyKKuzuGAkWNsRU7Q0St8BU7oPDdF9s4qFBfiBhA1RhX29fDyyOATndBSRuBhSPBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Zone = _t, Cluster = _t, #"% Completion" = _t]), #"Added Column" = Table.AddColumn(Source, "col", each {1,2}), #"Expanded col" = Table.ExpandListColumn(#"Added Column", "col") in #"Expanded col"