Forum Discussion
Rune_
6 years agoFrequent Visitor
List value if conditions are true
Hi, I have a table with a column "Document No_" who has 3 lines for each document value. Each line has different information for that document value. I want to consolidate that information i...
- Anonymous6 years ago
by applying this code to this table
you get want expected
Jimmy801
Community Champion
6 years agoHello Rune_
you can use Table.Pivot to solve this issue.
What I didn't get was why D000258 is not shown in your final table
Here the code
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcjEwMDAyNVXSUXL09Q/1C/H0c/YJcwwB8g1NTUyUYnWQlTiHBgU5+7u4AploMi6hri6OISAJAzM9A1M9IwNDC6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Document No_" = _t, Code = _t, #"Value (Text)" = _t]),
#"Pivoted Column" = Table.Pivot(Source, List.Distinct(Source[Code]), "Code", "Value (Text)"),
#"Changed Type" = Table.TransformColumnTypes(#"Pivoted Column",{{"AMOUNTINCLVAT", type number}, {"CURRCODE", type text}, {"DUEDATE", type date}})
in
#"Changed Type"
Copy paste this code to the advanced editor in a new blank query to see how the solution works.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy