Forum Discussion

bmcirillo's avatar
bmcirillo
Regular Visitor
6 years ago
Solved

Transform Table of Multiple Columns to Single Column

I am new to DAX and need some help figuring out the proper formula and syntax for a table transformation, which I can hopefully explain in a way that makes sense...   I have Table X with Unique IDs...
  • v-lili6-msft's avatar
    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