The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi, I am trying to create a measure summarizing the effort hours (a decimal type) per date (a day) for a given task (a string type)
I have the table tblTasks containing the taskID, taskName, taskEffortHours, and the second table called tblCalendar containing calendarID, taskID, calendarDate. The tables are joined on taskID collumn.
If I create a card in Power BI with Sum of taskEffortHours and using a date slider where I select the days, but the card is not displaying the sum correctly, it just sumarrizes the taskName names but not the days. That's why I need this measure that will calculate the effortHours per tasks and per days.
Please help with this, I spent days trying to figure out this measure.
Many thanks!
Solved! Go to Solution.
Hello @gabitu,
You can use the SUMX function in DAX along with FILTER to iterate through the tblCalendar table and calculate the sum of effort hours for each day and task combination.
Effort Hours Per Task Per Day =
SUMX(
VALUES(tblCalendar[calendarDate]),
CALCULATE(
SUM(tblTasks[taskEffortHours]),
FILTER(
tblCalendar,
tblCalendar[calendarDate] = EARLIER(tblCalendar[calendarDate])
)
)
)
Should you require further assistance please do not hesitate to reach out to me.
Thank you Sahir, this works as charm!
Hello @gabitu,
You can use the SUMX function in DAX along with FILTER to iterate through the tblCalendar table and calculate the sum of effort hours for each day and task combination.
Effort Hours Per Task Per Day =
SUMX(
VALUES(tblCalendar[calendarDate]),
CALCULATE(
SUM(tblTasks[taskEffortHours]),
FILTER(
tblCalendar,
tblCalendar[calendarDate] = EARLIER(tblCalendar[calendarDate])
)
)
)
Should you require further assistance please do not hesitate to reach out to me.
Thank you Sahir, works as charm!
Thanks you very much Sahir, I will try!
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
33 | |
13 | |
12 | |
9 | |
7 |