Forum Discussion

rocky09's avatar
rocky09
Solution Sage
8 years ago
Solved

Issue with Summarizing Status Count

See below table, I have cat. column, where Users start working on each cat. and change the status to Inprogress, Complete and some times rework.   So, if a Cat. worked on 5 days and status will be ...
  • v-ljerr-msft's avatar
    8 years ago

    Hi rocky09,

     

    Based on my test, the formula below should work in your scenario.

    Count = 
    VAR maxDate =
        CALCULATE (
            MAX ( Data[Date] ),
            FILTER ( ALL ( Data ), Data[Cat.] = EARLIER ( Data[Cat.] ) )
        )
    VAR minDate =
        CALCULATE (
            MAX ( Data[Date] ),
            FILTER ( ALL ( Data ), Data[Cat.] = EARLIER ( Data[Cat.] ) )
        )
    RETURN
        IF (
            Data[Status] = "Completed",
            1,
            IF ( Data[Date] = maxDate, 1 + DATEDIFF ( minDate, maxDate, DAY ) / 10, 0 )
        )
    

     

    Here is the sample pbix file for your reference. :smileyhappy:

     

    Regards