Forum Discussion
Transform Table of Multiple Columns to Single Column
- 6 years ago
HI bmcirillo
There are two way to for you refer to:
1. Duplicate a table in edit queries, then unpivot the Column A,B,C , filter out false and remove this column.
2. Use Union to create a new calculate table
New table = UNION(SELECTCOLUMNS(FILTER('Table','Table'[A]=TRUE()),"ID",[ID],"COMBINED","A"), SELECTCOLUMNS(FILTER('Table','Table'[B]=TRUE()),"ID",[ID],"COMBINED","B"), SELECTCOLUMNS(FILTER('Table','Table'[C]=TRUE()),"ID",[ID],"COMBINED","C") )Result:
and here is sample pbix file,please try it.
Regards,
Lin
HI bmcirillo
There are two way to for you refer to:
1. Duplicate a table in edit queries, then unpivot the Column A,B,C , filter out false and remove this column.
2. Use Union to create a new calculate table
New table =
UNION(SELECTCOLUMNS(FILTER('Table','Table'[A]=TRUE()),"ID",[ID],"COMBINED","A"),
SELECTCOLUMNS(FILTER('Table','Table'[B]=TRUE()),"ID",[ID],"COMBINED","B"),
SELECTCOLUMNS(FILTER('Table','Table'[C]=TRUE()),"ID",[ID],"COMBINED","C")
)
Result:
and here is sample pbix file,please try it.
Regards,
Lin
Thank you, I knew it wasn't that complicated! For some reason, when I was playing around with it I wasn't even thinking about unpivoting all of the columns in one go...I assumed I had to do each one individually and that's where I was running into issues.