Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi community,
Please can you assist we have a list of organisation numbers in one column in a .txt file.
This list contains all successful and unsuccesful organisation, example below:
| Org Num |
| Successful |
| 123456 |
| 789456 |
| 98697 |
| Not Successful |
| 7896563 |
| 56986358 |
| 59789 |
My requirement is to split the one column into two columns, Successful | Not successful
| Successful | Not Successful |
| 123456 | 7896563 |
| 789456 | 56986358 |
| 98697 | 59789 |
Or just return only the Successful list if thats easier.
Thanks in advance
Solved! Go to Solution.
Hi @databot_kd, check this:
Output
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCi5NTk4tLk4rzVFQitWJVjI0MjYxNQMzzS0sYUxLCzNLczALosovv0QBoROm2szUzBjMNjUDajA2tYBwLIFSSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Org Num" = _t]),
Transformed = Table.FromColumns(List.Combine(List.Transform(Table.SplitAt(Source, List.PositionOf(Source[Org Num], "Not Successful")), Table.ToColumns))),
PromotedHeaders = Table.PromoteHeaders(Transformed, [PromoteAllScalars=true]),
FilteredRows = Table.SelectRows(PromotedHeaders, each ([Not Successful] <> null))
in
FilteredRows
Use this formula
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
S1 = Source[Org Num],
Custom1 = Table.PromoteHeaders(Table.FromRows(List.Zip(List.Split(S1,List.PositionOf(S1,"Not Successful")))))
in
Custom1
Add Custom Column:
Hi @databot_kd, check this:
Output
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCi5NTk4tLk4rzVFQitWJVjI0MjYxNQMzzS0sYUxLCzNLczALosovv0QBoROm2szUzBjMNjUDajA2tYBwLIFSSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Org Num" = _t]),
Transformed = Table.FromColumns(List.Combine(List.Transform(Table.SplitAt(Source, List.PositionOf(Source[Org Num], "Not Successful")), Table.ToColumns))),
PromotedHeaders = Table.PromoteHeaders(Transformed, [PromoteAllScalars=true]),
FilteredRows = Table.SelectRows(PromotedHeaders, each ([Not Successful] <> null))
in
FilteredRows
Add Custom Column:
Give a thumsup if solution is up to mark
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |