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
Hi Fehrnovic,
You should create a bridge table with unique "TaskId" and "TaskName". Then, establish one to many relationship between bridge table and "Units" and "Tasks". Place "TaskName" from bridge table, "registered hours" from "Units" and "budget hours" from "Tasks" into Matrix.
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
- v-yulgu-msft8 years ago
Microsoft Employee
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