Forum Discussion

TomLU123's avatar
TomLU123
Icon for Helper III rankHelper III
8 years ago
Solved

Calculate the average completion rate

Dear Experts,

 

I have a data set like this. This data set is to capture the completion rate of each task on specific days. But there are empty values since the user havn't update the progress. 

Task DateValue
Task 11-Jun-1830%
Task 11-Jul-1840%
Task 11-Aug-18 
Task 21-Jun-1840%
Task 21-Jul-18 
Task 21-Aug-18 
Task 31-Jun-18 
Task 31-Jul-18 
Task 31-Aug-18 

 

I wish to calculate the Overvall Completion Rate by using the last percentage of each task (including the empty one).

In the example above, Overvall Completion Rate = (40%+40%)/3

 

Is there any expression to create a quick measure to achieve that?

Many thanks!

 

Best regards,

Tom

  • TomLU123

     

    We can use MAX instead of LASTDATE

     

    i.e.

     

    Measure =
    VAR Sumofpercentages =
        SUMX (
            VALUES ( Table1[Task] ),
            VAR Last_Checkpoint =
                CALCULATE ( MAX ( Table1[Check Point] ), Table1[Value] <> BLANK () )
            RETURN
                CALCULATE ( SUM ( Table1[Value] ), Table1[Check Point] = Last_Checkpoint )
        )
    VAR CountofTasks =
        COUNTROWS ( VALUES ( Table1[Task] ) )
    RETURN
        Sumofpercentages / CountofTasks
    

4 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Icon for Community Champion rankCommunity Champion

    TomLU123

     

    This MEASURE please

    My apologies.. I saw your notification then forgot to reply

     

     

    Measure =
    VAR Sumofpercentages =
        SUMX (
            VALUES ( Table1[Task] ),
            VAR Last_date =
                CALCULATE ( LASTDATE ( Table1[Date] ), Table1[Value] <> BLANK () )
            RETURN
                CALCULATE ( SUM ( Table1[Value] ), Table1[Date] = Last_date )
        )
    VAR CountofTasks =
        COUNTROWS ( VALUES ( Table1[Task] ) )
    RETURN
        Sumofpercentages / CountofTasks
    
      • TomLU123's avatar
        TomLU123
        Icon for Helper III rankHelper III

        Zubair_Muhammad

         

        Dear Zubair,

        Many thanks for your great help!

         

        Just a further check: what if the data set is using the Check Point Number instead of the Date. How should we modify the fomular to achieve the calculation?

        Task Check PointValue
        Task 1130%
        Task 1240%
        Task 13 
        Task 2140%
        Task 22 
        Task 23 
        Task 31 
        Task 32 
        Task 33 

         

        In the example above, Overvall Completion Rate = (40%+40%)/3

        Many thanks!

         

        Best regards,

        Tom