Forum Discussion
DAX Calculating Open Project Trends
- Anonymous2 years ago
Firstly you can create a calculated table as follows.
Date = CALENDAR(MIN('Table'[Actual Start Date]), DATE(2023,12,31))Then you can create two measures as follows.
severalweeksago = IF ( SELECTEDVALUE ( 'Table'[Actual Complete Date] ) > MAX ( 'Date'[Date] ) || SELECTEDVALUE ( 'Table'[Actual Start Date] ) < MAX ( 'Date'[Date] ) && SELECTEDVALUE ( 'Table'[Actual Complete Date] ) = BLANK (), 1, 0 )DateAge = IF(SELECTEDVALUE('Table'[Actual Complete Date]) > MAX('Date'[Date]) || SELECTEDVALUE('Table'[Actual Complete Date]) = BLANK(), DATEDIFF ( SELECTEDVALUE ( 'Table'[Actual Start Date] ), MAX ( 'Date'[Date] ), DAY ), DATEDIFF( SELECTEDVALUE('Table'[Actual Start Date]), SELECTEDVALUE('Table'[Actual Complete Date]), DAY) )Then put the measure into the filter so that the visual only shows data where the measure is equal to 1.
When the date reaches tomorrow, the today function may not update the date automatically, just click refresh to update it.
Is this the result you expect?
Best Regards,
Community Support Team_Yuliax
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Firstly you can create a calculated table as follows.
Date = CALENDAR(MIN('Table'[Actual Start Date]), DATE(2023,12,31))
Then you can create two measures as follows.
severalweeksago =
IF (
SELECTEDVALUE ( 'Table'[Actual Complete Date] )
> MAX ( 'Date'[Date] )
|| SELECTEDVALUE ( 'Table'[Actual Start Date] ) < MAX ( 'Date'[Date] )
&& SELECTEDVALUE ( 'Table'[Actual Complete Date] ) = BLANK (),
1,
0
)
DateAge =
IF(SELECTEDVALUE('Table'[Actual Complete Date]) > MAX('Date'[Date]) || SELECTEDVALUE('Table'[Actual Complete Date]) = BLANK(),
DATEDIFF (
SELECTEDVALUE ( 'Table'[Actual Start Date] ),
MAX ( 'Date'[Date] ),
DAY
),
DATEDIFF(
SELECTEDVALUE('Table'[Actual Start Date]),
SELECTEDVALUE('Table'[Actual Complete Date]),
DAY)
)
Then put the measure into the filter so that the visual only shows data where the measure is equal to 1.
When the date reaches tomorrow, the today function may not update the date automatically, just click refresh to update it.
Is this the result you expect?
Best Regards,
Community Support Team_Yuliax
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.