Forum Discussion
Table merge with a specific Condition
- 4 years ago
You can't do a simple UNION between the tables as there appear to be different columns between the tables, however you can use SELECTCOLUMNS to build a table with the required columns, something like
New Table = var documentNumArchived = EXCEPT( VALUES(Archived[Document no]), VALUES(Active[Document no]) ) return UNION( SELECTCOLUMNS( Active, column list here), CALCULATETABLE( SELECTCOLUMNS(Archived, column list here), documentNumArchived) ) - 4 years ago
In the SELECTCOLUMNS you can create a column which specifies which table it comes from, you could then filter on that
You can't do a simple UNION between the tables as there appear to be different columns between the tables, however you can use SELECTCOLUMNS to build a table with the required columns, something like
New Table =
var documentNumArchived = EXCEPT( VALUES(Archived[Document no]), VALUES(Active[Document no]) )
return UNION( SELECTCOLUMNS( Active, column list here),
CALCULATETABLE( SELECTCOLUMNS(Archived, column list here), documentNumArchived)
)- Macwin4 years agoHelper I
Thanks for the Reply 🙂
I got the table created. Is there a possibilty to filter this table like I mention it in the first post ?
for example as new bool column so i can use it for a visual slicer filter
- johnt754 years agoSuper User
In the SELECTCOLUMNS you can create a column which specifies which table it comes from, you could then filter on that