Forum Discussion
Get value from another dataset with a corresponding column column
- 8 years ago
Hi Fehrnovic,
Since you only want the "TaskName" shown in the matrix, not the Id, there is no need to add "ID" column into bridge table. You just need to establish relationship between bridge table and "Task" and "Units" table based on "TaskName" field.
But how is the bridge table created when I need both the unique "TaskName" and "TaskId" column in the same table?
Please refer to this formula:
Bridge table = UNION ( DISTINCT ( SELECTCOLUMNS ( Units, "id", Units[ProjectID], "name", Units[ProjectName] ) ), EXCEPT ( DISTINCT ( SELECTCOLUMNS ( Projects, "id", Projects[ID], "name", Projects[Name] ) ), DISTINCT ( SELECTCOLUMNS ( Units, "id", Units[ProjectID], "name", Units[ProjectName] ) ) ) )Best regards,
Yuliana Gu
Hey v-yulgu-msft,
Thank you. This answer makes a lot of sense, but I can't seem to create the brigde table right. I have created multiple bridge tables for a single column using the following code:
ProjectName - Merged = DISTINCT(UNION(VALUES(Units[ProjectName]),VALUES(Projects[Name])))
But how is the bridge table created when I need both the unique "TaskName" and "TaskId" column in the same table?
Thank you very much in advance
Hi Fehrnovic,
Since you only want the "TaskName" shown in the matrix, not the Id, there is no need to add "ID" column into bridge table. You just need to establish relationship between bridge table and "Task" and "Units" table based on "TaskName" field.
But how is the bridge table created when I need both the unique "TaskName" and "TaskId" column in the same table?
Please refer to this formula:
Bridge table =
UNION (
DISTINCT (
SELECTCOLUMNS ( Units, "id", Units[ProjectID], "name", Units[ProjectName] )
),
EXCEPT (
DISTINCT (
SELECTCOLUMNS ( Projects, "id", Projects[ID], "name", Projects[Name] )
),
DISTINCT (
SELECTCOLUMNS ( Units, "id", Units[ProjectID], "name", Units[ProjectName] )
)
)
)
Best regards,
Yuliana Gu