Forum Discussion
Create a new table from columns from existing tables
- Anonymous9 years ago
Hi anguyen83,
You can simply use below formula merge these tables.
New Table= UNION(SELECTCOLUMNS(Table1,"Stage","TS1","Date",[TS1]),SELECTCOLUMNS(Table2,"Stage","TS2","Date",[TS2]),SELECTCOLUMNS(Table3,"Stage","TS3","Date",[TS3]),SELECTCOLUMNS(Table4,"Stage","TS4","Date",[TS4]))
Regards,
Xiaoxin Sheng
Hi Bhavesh
Thank you for your response.
Really do appreciate you reaching out to me because I'm struggling to with this software as I been using MS ACCESS all my life
I have below is an example. There are 4 tables and each table has one column with dates and the field name TS1-4
What I need to do is create a new table, and take the field names of each of the table and create it's own column corresponding to the contents in each table.
So at the end I will get a what is in New table
In MS access I would do a make table query taking the data from TS1 and then an append query using the remaing tables
How does it work for Power BI?
Hi anguyen83,
You can simply use below formula merge these tables.
New Table= UNION(SELECTCOLUMNS(Table1,"Stage","TS1","Date",[TS1]),SELECTCOLUMNS(Table2,"Stage","TS2","Date",[TS2]),SELECTCOLUMNS(Table3,"Stage","TS3","Date",[TS3]),SELECTCOLUMNS(Table4,"Stage","TS4","Date",[TS4]))
Regards,
Xiaoxin Sheng
- anguyen839 years agoFrequent Visitor
Hi Xiaoxin
Thank you for your help. The first two selectcolumns worked pulling the data from the table called 'lead' however when I add in the remaing selectcolumns getting the data from a table called 'Contacts' it doesn't seem to work
Is there something wrong with my query? I'm not familar with DAX
It's halfway their
Thank you
- Anonymous9 years agoNot applicable
Hi anguyen83,
The first parameter of selectcolumns function is table type.(based on your screenshot, I find you input a column)
Regards,
Xiaoxin Sheng
- anguyen839 years agoFrequent Visitor
Hi Xiaoxin
Not sure what you mean by that?
Would you be able to provide an example? sorry the language of DAX is new to me.