Forum Discussion

SClark513's avatar
SClark513
Copper Contributor
Nov 13, 2024
Solved

Task with multiple resources showing as multiple rows in Power BI table; instead of just the one row

Question please.   I have Project on the Web schedule with many tasks, and some have multiple resources assigned. When I pull the tasks into a table in Power BI report I am getting a row for each t...
  • RodFromm's avatar
    Nov 15, 2024

    SClark513This can be done in Power Query.  However, depending upon the size of your dataset/tables performance may be a concern.  How you include this in you model will vary, but the following will show you how to do it then you can determine what works in your model.  Anyways, here is what you need to do.

    Sorry for the formatting, but the new site would no allow me to post this with a number and/or bulleted list formatting.

    Create a TaskRsrcList query using msdyn_resourceassignments, including only the msdyn_taskid and msdyn_bookableresourceid fields

    Create RsrcLkpList query using the bookableresources, inlcuding only the msdyn_bookableresourceid and Resource name fields

    Merge the TaskRsrcList and RsrcLkp tables on msdyn_bookableresourceid column

    Go to Transform then click Group By.
    In the Group By dialog box:
    Select Group by msdyn_taskid
    New column name: ResourceList
    Operation: All Rows
    Click OK.
    Now, you will have a table grouped by ID with a nested table in the ResourceList column.

    Next, you need to concatenate the resource values:
    Add a Custom Column by going to the Add Column tab and clicking on Custom Column.
    Name new column Concatenated Resources 
    In the Custom Column dialog box, enter the following formula:

    Text.Combine([ResourceList][Resource], ", ")

    Click OK.
    Remove the ResourceList column if you no longer need it
    Incorporate this into your model as needed.

     

Resources