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.
Hi, I'm trying to create a line chart of resource overallocation against time like below:
However, I would also like for the user viewing the report to be able to choose which resources are displayed in the chart.
I have 2 data sources.
The first is a table of assignment work against time. Resources can have multiple assignments on the same day.
The second table is of resource capacity over time.
My current idea involves the following:
1. Group data in Assignment table by day/resource to get each resource's work by day.
2. Merging the queries (tables 1 and 2) using a custom ID column (concat of TimeByDay and ResourceName).
3. Subtracting Capacity from WorkByDay to get Overallocation.
4. Pivoting ResourceName column to give the following table:
5. Adding the individual fields (resource) to the line chart.
My questions are:
Thank you in advance for any advice!
Solved! Go to Solution.
HI @liyanc,
#1, For your scenario, I do not so recommend you to change your table structure, new structure not suitable for your requirement.
In my opinion, I'd like to suggest adding a calculated column to concatenate 'date' and 'resource name' fields to these tables. Then you can create a calculated table with merged concatenate fields as a bridge to link two tables.
Calculated column:
Resource Date =
Table[TimeByDay] & "-" & Table[ResourceName]
Calculated table:
Bridge =
ADDCOLUMNS (
DISTINCT (
UNION ( VALUES ( Table1[Resource Date] ), VALUES ( Table2[Resource Date] ) )
),
"TimeByDay", PATHITEM ( SUBSTITUTE ( [Resource Date], "-", "|" ), 1 ),
"ResourceName", PATHITEM ( SUBSTITUTE ( [Resource Date], "-", "|" ), 2 )
)
After these steps, you can simply use bridge table fields to analytic records between two tables.
Relationship in Power BI with Multiple Columns
#2, You can link the detailed information table with the bridge table 'ResourceName' field.
Regards,
Xiaoxin Sheng
HI @liyanc,
#1, For your scenario, I do not so recommend you to change your table structure, new structure not suitable for your requirement.
In my opinion, I'd like to suggest adding a calculated column to concatenate 'date' and 'resource name' fields to these tables. Then you can create a calculated table with merged concatenate fields as a bridge to link two tables.
Calculated column:
Resource Date =
Table[TimeByDay] & "-" & Table[ResourceName]
Calculated table:
Bridge =
ADDCOLUMNS (
DISTINCT (
UNION ( VALUES ( Table1[Resource Date] ), VALUES ( Table2[Resource Date] ) )
),
"TimeByDay", PATHITEM ( SUBSTITUTE ( [Resource Date], "-", "|" ), 1 ),
"ResourceName", PATHITEM ( SUBSTITUTE ( [Resource Date], "-", "|" ), 2 )
)
After these steps, you can simply use bridge table fields to analytic records between two tables.
Relationship in Power BI with Multiple Columns
#2, You can link the detailed information table with the bridge table 'ResourceName' field.
Regards,
Xiaoxin Sheng
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
23 | |
3 | |
2 | |
2 | |
2 |