Forum Discussion

nh27's avatar
nh27
Helper III
2 years ago
Solved

Use DAX to create a table

I have 7 tables that are all connected via one to many and many to many relationships, however I need a new table created just referencing specific columns from all these connected tables.

 

Is there a way to do this with DAX?

  • Not sure of the purpose but here's one way of doing it. For many-to-many relationships, you might need to use RELATEDTABLE and aggregate functions to correctly summarize the data.

     

    NewTable = SELECTCOLUMNS(
    Table1,
    "NewColumnA", Table1[ColumnA],
    "NewColumnB", RELATED(Table2[ColumnB]),
    "NewColumnC", RELATED(Table3[ColumnC]),
    ...
    )

     

1 Reply

  • amustafa's avatar
    amustafa
    Solution Sage

    Not sure of the purpose but here's one way of doing it. For many-to-many relationships, you might need to use RELATEDTABLE and aggregate functions to correctly summarize the data.

     

    NewTable = SELECTCOLUMNS(
    Table1,
    "NewColumnA", Table1[ColumnA],
    "NewColumnB", RELATED(Table2[ColumnB]),
    "NewColumnC", RELATED(Table3[ColumnC]),
    ...
    )