Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Fehrnovic
Frequent Visitor

Get value from another dataset with a corresponding column column

I don't know how to phrase this better but I have two datasets "Units" and "Tasks" containing different information. However, they share the columns "TaskName" and "TaskId".

 

The matrix i use displays information from "Units", including registered hours, for each "TaskName" in the dataset "Units". For each of these tasks in "Units", I want the corresponding field "BudgetHours" from the dataset "Tasks". How is this accomplished? I've tried making a bridge table with "TaskId" but it didn't work, and also I want the "TaskName" shown in the matrix, not the Id.

Here is what my matrix looks like:

spørgsmål.PNG

 

As you can see, it doesn't show the budget hours corresponding to the single task, but just the total of all tasks.

I would appreciate any help, thank you so much!

 

1 ACCEPTED SOLUTION

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

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yulgu-msft
Employee
Employee

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

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.