Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi all,
I am unable to provide a pbix file, so I have added everything I can in here.
I am working on a report which looks like below matrix table, which is wrong. I would like output that looks like one of the two Ideal examples below this table.
Current output (wrong):
Project ID | Project Demand (Hours) | Staff Assignments (Hours) |
AAA | 100 | 100 |
Alice | 100 | 50 |
Adam | 100 | 50 |
Bob | 100 (Bob should not appear under this ProjectID as they have no Assignments) | 0 |
Bill | 100 (Bill should not appear under this ProjectID as they have no Assignments) | 0 |
BBB | 50 | 50 |
Alice | 50 (Alice should not appear under this ProjectID as they have no Assignments) | 0 |
Adam | 50 (Adam should not appear under this ProjectID as they have no Assignments) | 0 |
Bob | 50 | 25 |
Bill | 50 | 25 |
Grand Total | 150 (This is the SUM of the Project Demand Hours for each "Distinct" ProjectID (AAA + BBB)) | 150 (This is the SUM of "ALL" the staff Assignments for each ProjectID) |
Ideal output version 1:
Project ID | Project Demand (Hours) | Staff Assignments (Hours) |
AAA | 100 | 100 |
Alice |
| 50 |
Adam |
| 50 |
BBB | 50 | 50 |
Bob |
| 25 |
Bill |
| 25 |
Grand Total | 150 | 150 |
Ideal output version 2:
Project ID | Project Demand (Hours) | Staff Assignments (Hours) |
AAA | 100 | 100 |
Alice | 100 | 50 |
Adam | 100 | 50 |
BBB | 50 | 50 |
Bob | 50 | 25 |
Bill | 50 | 25 |
Grand Total | 150 | 150 |
2 Datasets:
1) Project Data
ProjectID | Project Demand (Hours) |
AAA | 100 |
BBB | 50 |
2) Staff Assignments Data
ProjectID | Staff Name | Staff Assignments (Hours) |
AAA | Alice | 50 |
AAA | Adam | 50 |
BBB | Bob | 25 |
BBB | Bill | 25 |
Data Limitations:
Problem:
What I would like help with:
Thanks in advance, I hope I am communicating my requirements clearly.
Solved! Go to Solution.
With a one-to-many relationship from the projects table to the staff assignments table you can create a couple of measures like
Project Demand Total = IF( NOT ISINSCOPE( 'Staff Assignments'[Staff Name]),
SUM( 'Project Demand'[Project Demand (Hours)])
)
Staff Assignnments Total = CALCULATE(
SUM( 'Staff Assignments'[Staff Assignments ( Hours )]),
'Staff Assignments'[Staff Assignments ( Hours )] > 0
)
With a one-to-many relationship from the projects table to the staff assignments table you can create a couple of measures like
Project Demand Total = IF( NOT ISINSCOPE( 'Staff Assignments'[Staff Name]),
SUM( 'Project Demand'[Project Demand (Hours)])
)
Staff Assignnments Total = CALCULATE(
SUM( 'Staff Assignments'[Staff Assignments ( Hours )]),
'Staff Assignments'[Staff Assignments ( Hours )] > 0
)
Hi John, I have just been doing some testing. From my matrix, I have exported the report data to Excel, and the numeric values do not export at all. Do you know why your measure would be preventing the values from being exported?
I haven't come across that issue before, but I rarely export to Excel.
Hi John, Thank you for taking the time to read my long post! Thank you so much. Your solution has worked perfectly. I have been trying to solve this for a very very long time. I appreciate your help!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |