Forum Discussion

ryan_b_fiting's avatar
ryan_b_fiting
Post Patron
2 years ago
Solved

DAX Calculating Open Project Trends

Hello Community -  I am looking to calculate Open Project Counts and the age buckets that these projects are past due.  Here is a small sample set of data with just four of the key data points: ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi ryan_b_fiting 

     

    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.