Forum Discussion
Problem Creating a table using columns from different tables (DAX)
- 4 years ago
Hi, HamidBee
Calculatetable is not used to connect tables, so the latter code has no effect.
CALCULATETABLE function (DAX) - DAX | Microsoft Docs
Calculatetable and Union function both will create a new table.
Like this:
Table = UNION ( SELECTCOLUMNS ( '2020', "values", '2020'[Value], "Dates", '2020'[Dates] ), SELECTCOLUMNS ( '2021', "values", '2021'[Value], "Dates", '2021'[Dates] ) )This table can be displayed in the desktop as a new table, or as a variable table in the measure.
If you don't want to add the third table, you can easily append them in PowerQuery.
Like this:
Below is my sample.
Did I answer your question ? Please mark my reply as solution. Thank you very much.If not, please feel free to ask me.Best Regards,Community Support Team _ Janey
Hi, HamidBee
Calculatetable is not used to connect tables, so the latter code has no effect.
CALCULATETABLE function (DAX) - DAX | Microsoft Docs
Calculatetable and Union function both will create a new table.
Like this:
Table =
UNION (
SELECTCOLUMNS ( '2020', "values", '2020'[Value], "Dates", '2020'[Dates] ),
SELECTCOLUMNS ( '2021', "values", '2021'[Value], "Dates", '2021'[Dates] )
)
This table can be displayed in the desktop as a new table, or as a variable table in the measure.
If you don't want to add the third table, you can easily append them in PowerQuery.
Like this:
Below is my sample.