Forum Discussion
pbi1908
3 years agoHelper III
Calculated Table with DAX
Hi guys, I have 2 tables, in one i have Projects and in the other i have tasks. I would lilke to create a new table with 2 columns, in the first i want to have a union of distinct Names (Projec...
- 3 years ago
Hi,
Thank you for your feedback.
Please check the below DAX formula whether it suits your requirement.
Additionally, if you want to change a column name, you can try to use SELECTCOLUMNS DAX function as well.
New table = SELECTCOLUMNS ( UNION ( ADDCOLUMNS ( DISTINCT ( Projects[Project name] ), "Table name", "Project" ), ADDCOLUMNS ( DISTINCT ( Tasks[Task name] ), "Table name", "Task" ) ), "@Name", Projects[Project name], "@Table", [Table name] )
pbi1908
3 years agoHelper III
Jihwan_Kim Hmm yes since i have multiple columns in the table how can i select only the ProjectName from Projects table and only the TaskName from Tasks table instead of all the table?
Jihwan_Kim
3 years agoSuper User
Hi,
Thank you for your feedback.
Please check the below DAX formula whether it suits your requirement.
Additionally, if you want to change a column name, you can try to use SELECTCOLUMNS DAX function as well.
New table =
SELECTCOLUMNS (
UNION (
ADDCOLUMNS ( DISTINCT ( Projects[Project name] ), "Table name", "Project" ),
ADDCOLUMNS ( DISTINCT ( Tasks[Task name] ), "Table name", "Task" )
),
"@Name", Projects[Project name],
"@Table", [Table name]
)