Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hello,
I would like to create a "calendared" dataset showing the aggregate effort for each resource for each day.
My model consists of:
The output should be a table where each row has: each resource and each day, calculate the sum of the effort.
Resource 1 | Day 1 | Effort:100
Resource 1 | Day 2 | Effort:50
Resource 1 | Day 3 | Effort:50
Resource 2 | Day 1 | Effort:100
Resource 2 | Day 2 | Effort:100
Resource 2 | Day 3 | Effort:25
The challenge I am facing is that the tasks have a start and end date and I am not sure how to build the filters to perform that computation (attached PowerBI model).
Any advice on how to proceed would be greatly appreciated (link to .pbix model: CLICK HERE )
Thank you
Solved! Go to Solution.
Hi @gianfrancob ,
We can create a calculated table as below.
Table 3 = VAR k = ADDCOLUMNS ( CROSSJOIN ( DISTINCT ( 'Table'[task_id] ), CALENDARAUTO () ), "id", 'Table'[task_id] ) VAR eff = ADDCOLUMNS ( k, "a", CALCULATE ( SUM ( Tasks[effort] ), FILTER ( Tasks, 'Tasks'[task_id] = [id] && [Date] >= Tasks[start_date] && [Date] <= Tasks[end_date] ) ) ) RETURN FILTER ( eff, [a] <> BLANK () && [a] >= 0 )
Hi @gianfrancob ,
We can create a calculated table as below.
Table 3 = VAR k = ADDCOLUMNS ( CROSSJOIN ( DISTINCT ( 'Table'[task_id] ), CALENDARAUTO () ), "id", 'Table'[task_id] ) VAR eff = ADDCOLUMNS ( k, "a", CALCULATE ( SUM ( Tasks[effort] ), FILTER ( Tasks, 'Tasks'[task_id] = [id] && [Date] >= Tasks[start_date] && [Date] <= Tasks[end_date] ) ) ) RETURN FILTER ( eff, [a] <> BLANK () && [a] >= 0 )
Hi,
thank you for the response, it seems to be working on the test dataset - I will roll that out on the PROD one.
It would be great if you could also explain a few things regarding the solution:
Table = SUMMARIZECOLUMNS(Tasks[end_date],Tasks[start_date],Tasks[task_id],"value",SUM(Tasks[effort]))
Thank you
Best,
Gian
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
89 | |
82 | |
56 | |
41 | |
37 |