Forum Discussion
Anonymous
6 years agoNot applicable
Date Diff and group
Hi, I'm trying to work out how many records are out of target by using a datediff. I have the target date and im going to use TODAY. The idea is that if Today's date is greater than the targe...
- 6 years ago
Hi Anonymous ,
I create an example.
ID Open Date Target Date 1 11/1/2019 11/19/2019 2 11/2/2019 11/21/2019 3 11/3/2019 11/18/2019 4 11/4/2019 11/20/2019 5 11/5/2019 11/22/2019 6 11/6/2019 11/30/2019 Create measures like so:
IsOverdue = IF ( TODAY () > MAX ( 'Table'[Target Date] ), 1, 0 )Count of IsOverdue = SUMX ( 'Table', [IsOverdue] )Or, you can create measures like so:
DateDiff of Day = DATEDIFF ( MAX ( 'Table'[Target Date] ), TODAY (), DAY )IsOverdue 2 = IF ( [DateDiff of Day] > 0, 1, 0 )Count of IsOverdue 2 = SUMX ( 'Table', [IsOverdue 2] )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Icey
Community Support
6 years agoHi Anonymous ,
I create an example.
| ID | Open Date | Target Date |
| 1 | 11/1/2019 | 11/19/2019 |
| 2 | 11/2/2019 | 11/21/2019 |
| 3 | 11/3/2019 | 11/18/2019 |
| 4 | 11/4/2019 | 11/20/2019 |
| 5 | 11/5/2019 | 11/22/2019 |
| 6 | 11/6/2019 | 11/30/2019 |
Create measures like so:
IsOverdue = IF ( TODAY () > MAX ( 'Table'[Target Date] ), 1, 0 )Count of IsOverdue = SUMX ( 'Table', [IsOverdue] )
Or, you can create measures like so:
DateDiff of Day = DATEDIFF ( MAX ( 'Table'[Target Date] ), TODAY (), DAY )IsOverdue 2 = IF ( [DateDiff of Day] > 0, 1, 0 )Count of IsOverdue 2 = SUMX ( 'Table', [IsOverdue 2] )
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.