Forum Discussion
Anonymous
7 years agoNot applicable
Add table to query editor
Hi, I want to add one table to another and I know how to do it in the query editor. But the table I want to add was created outside the query editor in the "data" area. So the table is not sh...
- 7 years ago
Anonymous
7 years agoNot applicable
Hi parry2k ,
the only reason why I want it in Power Query is, because I know how to work with it there. But a DAX solution would also be fine.
Here are the different example tables:
table 1 (Power Query) name type value month year A ext 3 may 2018 B ext 3 jun 2018 table 2 (DAX) name type value year position C int 2 2017 doe D int 4 2017 doe2 final table name type value month year position A ext 3 may 2018 0 B ext 3 jun 2018 0 C int 2 0 2017 doe D int 4 0 2017 doe2
My goal is to have the final table.
The DAX code for table 2 is:
FinalTable =
CALCULATETABLE (
'TEMPTABLE';
FILTER (
'TEMPTABLE';
'TEMPTABLE'[Value]
<= IF ( ISBLANK ( YEAR ( 'TEMPTABLE'[exit] ) ); 2019; YEAR ( 'TEMPTABLE'[exit] ) )
&& 'TEMPTABLE'[Value] >= YEAR ( 'TEMPTABLE'[entry] )
)
)But this is different from my example tables above, as the real tables are much more complex.
I justs need to understand the logic, how to match certain columns in different tables to form a new table.
Thank you!
Mark
parry2k
7 years agoSuper User