Forum Discussion
Current Level and Next Due Date
Hello! I am looking to automatically calculate the current level (all Sub-Tasks have to be completed) that I am on and when the next one is due. This is what my table looks like:
| Level | Sub-Task | Due Date | Status |
| 1 | 1.1 | 01/01/2024 | Completed |
| 2 | 2.1 | 06/01/2024 | Completed |
| 2 | 2.2 | 07/01/2024 | Completed |
| 3 | 3.1 | 09/01/2024 | Open |
| 3 | 3.2 | 08/01/2024 | Completed |
The results would be:
Current Completed Level: 2 (working on completing level 3)
Next Level Due Date: 09/01/2024 (So I need to complete the last task for level 3 by 09/01/2024 even if it is the first sub-task for that level)
Thank you!!!
- Anonymous2 years ago
Hi lackeyj ,
I create a table as you mentioned.
Next I create a calculated column named All_Tasks_Completed.
All_Tasks_Completed = VAR CurrentLevel = 'Table'[Level] RETURN IF( COUNTROWS( FILTER( 'Table', 'Table'[Level] = CurrentLevel && 'Table'[Status] <> "Completed" ) ) = 0, 1, 0 )Then I create a measure named Current Completed Level.
Current Completed Level = MAXX( FILTER( 'Table', 'Table'[All_Tasks_Completed] = 1 ), 'Table'[Level] )Finally I create a measure named Next Level Due Date.
Next Level Due Date = VAR NextLevel = [Current Completed Level] + 1 RETURN CALCULATE( MAX('Table'[Due Date]), FILTER( 'Table', 'Table'[Level] = NextLevel ) )Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- AnonymousNot applicable
Hi lackeyj ,
I create a table as you mentioned.
Next I create a calculated column named All_Tasks_Completed.
All_Tasks_Completed = VAR CurrentLevel = 'Table'[Level] RETURN IF( COUNTROWS( FILTER( 'Table', 'Table'[Level] = CurrentLevel && 'Table'[Status] <> "Completed" ) ) = 0, 1, 0 )Then I create a measure named Current Completed Level.
Current Completed Level = MAXX( FILTER( 'Table', 'Table'[All_Tasks_Completed] = 1 ), 'Table'[Level] )Finally I create a measure named Next Level Due Date.
Next Level Due Date = VAR NextLevel = [Current Completed Level] + 1 RETURN CALCULATE( MAX('Table'[Due Date]), FILTER( 'Table', 'Table'[Level] = NextLevel ) )Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.