Forum Discussion

prashantg364's avatar
prashantg364
Helper II
3 years ago

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

ZoneCluster% Completion
BRBR-MZPR92%
BRBR-PTNA95%
BRBR-GAYA91%
BRBR-PTNAK98%
BRBR-GAYAL92%
BRBR-PTNAM92%
BRBR-PURN90%
BRBR-MKMH95%
BRBR-MZPRD96%

 

Ouput table required

ZoneCluster% CompletionBand
BRBR-MZPR92%1
BRBR-MZPR92%2
BRBR-PTNA95%1
BRBR-PTNA95%2
BRBR-GAYA91%1
BRBR-GAYA91%2
BRBR-PTNAK98%1
BRBR-PTNAK98%2
BRBR-GAYAL92%1
BRBR-GAYAL92%2
BRBR-PTNAM92%1
BRBR-PTNAM92%2
BRBR-PURN90%1
BRBR-PURN90%2
BRBR-MKMH95%1
BRBR-MKMH95%2
BRBR-MZPRD96%1
BRBR-MZPRD96%2

1 Reply

  • 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"