Forum Discussion
Dynamic table to calculate team overload
- 7 years ago
Hi Anonymous,
What I can find for Question 1 is a calculated table. Please try it out.
Table = ADDCOLUMNS ( FILTER ( CROSSJOIN ( SELECTCOLUMNS ( JIRA, "Assignee", [Assignee], "Effective hours", [Effective hours], "IssueKey", [IssueKey], "Start date", [Start date], "DUEDATE", [DUEDATE], "Remaining estimate", [Remaining estimate], "date diff", [date diff], "IndexNew", [IndexNew], "SUMMARY", [SUMMARY] ), SELECTCOLUMNS ( 'Calendar', "Date", [Date] ) ), [Date] >= TODAY () && [Date] <= EDATE ( TODAY (), 2 ) ), "dd", [Solution] )
Regarding question 2, I would suggest you create a new thread in this forum.
Best Regards,
Dale
Hi, v-jiascu-msft
I moved calculation to production, everything works fine, exept those task wich have no start date, there are always - 0 hours.
I tried calculations in Excel everything works fine, but in Power BI they dosen't count, where could be the problem?
Link to excel file:
https://drive.google.com/open?id=1X8xDzloVxGz6mFoXsjmWFYJs7M4oUn1S
Sorry, v-jiascu-msft my bad, I had foggoten Effective hours.
One more question, how can I calculate just working days?
I tried to filter Calendar query, but then report don't show today.
When I write additional filter in var day formula FILTER('Calendar'; 'Calendar'[WeekdayWeekend]="Weekday", it doesn't show any date.
- Anonymous7 years agoNot applicable
Thanks v-jiascu-msft for the help.
All solution is here:
https://drive.google.com/open?id=1lfowi1yxKABf9IgLS3OX8FaRvHGb7cZI
- v-jiascu-msft7 years agoMicrosoft Employee
Hi Anonymous,
Please replace the [Solution] with this one.
Solution = VAR accumulateRemaining = CALCULATE ( SUM ( JIRA[Remaining estimate] ), FILTER ( ALLEXCEPT ( JIRA, JIRA[Assignee] ), JIRA[IndexNew] <= MIN ( JIRA[IndexNew] ) ) ) VAR days = CALCULATE ( COUNT ( 'Calendar'[Date] ), FILTER ( ALL ( 'Calendar'[Date] ), 'Calendar'[Date] < MIN ( 'Calendar'[Date] ) && 'Calendar'[Date] >= TODAY () ) ) VAR accumulateToLast = accumulateRemaining - SUM ( JIRA[Remaining estimate] ) VAR leftBound = days * MIN ( JIRA[Effective hours] ) VAR rightBound = ( days + 1 ) * MIN ( JIRA[Effective hours] ) RETURN IF ( ISBLANK ( MIN ( JIRA[Start date] ) ), IF ( accumulateToLast <= leftBound && accumulateRemaining <= leftBound, 0, IF ( accumulateToLast <= leftBound && accumulateRemaining >= leftBound && accumulateRemaining <= rightBound, accumulateRemaining - leftBound, IF ( accumulateToLast >= leftBound && accumulateRemaining <= rightBound, accumulateRemaining - accumulateToLast, IF ( accumulateToLast <= leftBound && accumulateRemaining >= rightBound, MIN ( JIRA[Effective hours] ), IF ( accumulateToLast <= rightBound && accumulateRemaining >= rightBound, rightBound - accumulateToLast, 0 ) ) ) ) ), IF ( MIN ( JIRA[Start date] ) <= MIN ( 'Calendar'[Date] ) && MIN ( JIRA[DUEDATE] ) >= MIN ( 'Calendar'[Date] ) && MIN ( 'Calendar'[isWeekDay] ) = 1, DIVIDE ( SUM ( JIRA[Remaining estimate] ), CALCULATE ( SUM ( 'Calendar'[isWeekDay] ), FILTER ( ALL ( 'Calendar'[Date] ), MIN ( JIRA[Start date] ) <= 'Calendar'[Date] && MIN ( JIRA[DUEDATE] ) >= 'Calendar'[Date] && MIN ( 'Calendar'[isWeekDay] ) = 1 ) ) ), 0 ) )
Best Regards,
Dale - Anonymous7 years agoNot applicable
Thanks, v-jiascu-msft it's working.
I hope it will be my last requests.
As I understand if I choose to see date hierarchy in the comulmns, the measure interpret month as a date and splited hours shows just 6. How can I see total splited hours for a month/ year? And is it possible to sum them?
And one more: is it possible that in thease cases, that there is no start date it will split days till Due Date, and if there any hours left he will put all in Due date (not looking at Effective hours). There won't be any hours splited after Due date
For Example if he has Remaining Estimate = 54.75 hours, ant task's Due date 2018-12-03, it will put all 54.75 to Due Date day.
And if we change Due date to - 2018-12-06, than it will be:
2018-12-03 = 6 hours
2018-12-04 = 6 hours
2018-12-05 = 6 hours
2018-12-06 = 36.75 hours
PBIX file:
https://drive.google.com/open?id=1g9VrtgdChSAPwVZKiQANz601uNUmXch8
- v-jiascu-msft7 years agoMicrosoft Employee
Hi Anonymous,
What I can find for Question 1 is a calculated table. Please try it out.
Table = ADDCOLUMNS ( FILTER ( CROSSJOIN ( SELECTCOLUMNS ( JIRA, "Assignee", [Assignee], "Effective hours", [Effective hours], "IssueKey", [IssueKey], "Start date", [Start date], "DUEDATE", [DUEDATE], "Remaining estimate", [Remaining estimate], "date diff", [date diff], "IndexNew", [IndexNew], "SUMMARY", [SUMMARY] ), SELECTCOLUMNS ( 'Calendar', "Date", [Date] ) ), [Date] >= TODAY () && [Date] <= EDATE ( TODAY (), 2 ) ), "dd", [Solution] )
Regarding question 2, I would suggest you create a new thread in this forum.
Best Regards,
Dale
