Forum Discussion
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
- amustafaSolution 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]),
...
)