Forum Discussion

ruyaselman's avatar
ruyaselman
Icon for Helper I rankHelper I
7 years ago
Solved

How to calculate the Average Performance for the previous entry vs latest entry

Dear All,   I have a datasource, where we insert updates by weekly (every week have an increase in task progress and we instert it with relevant date)   I need to calculate the progress dev...
  • v-eachen-msft's avatar
    7 years ago

    Hi ruyaselman ,

     

    You need to create a new column.

    Previous Week =
    CALCULATE (
        FIRSTNONBLANK ( Sheet1[Progress], 1 ),
        FILTER (
            Sheet1,
            Sheet1[date]
                = EARLIER ( Sheet1[date] ) - 7
                && Sheet1[Task] = EARLIER ( Sheet1[Task] )
        )
    )
    

    Then edit your measure.

    Progress for Previous Date =
    CALCULATE ( AVERAGE ( Sheet1[Previous Week] ) )
    

    Here is the result.

     

    Best Regards,

    Eads

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • v-eachen-msft's avatar
    v-eachen-msft
    7 years ago

    Hi ruyaselman ,

     

    You can create a new column in  "Original DS".

    Previous Week =
    VAR a =
        CALCULATE ( LASTDATE ( 'Original DS'[PrgDate] ), ALL ( 'Original DS' ) )
    RETURN
        IF ( 'Original DS'[PrgDate] = a, BLANK (), 'Original DS'[PrgDate] )

    Then edit your meaure "Progress for Previous Date Original DS"

    Progress for Previous Date Original DS = 
    CALCULATE(AVERAGE('Original DS'[Task Progress %]),LASTDATE('Original DS'[Previous Week]))

    Here is the result:

    Best Regards,

    Eads

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.