Forum Discussion

jlum's avatar
jlum
Frequent Visitor
9 years ago
Solved

Moving average over non-numeric values

Hi, I'm trying to create a measure for calculating a 3 day moving average of unique events of string type.   On the dashboard there is a timeline slicer for date, so the user can visualize the dash...
  • v-sihou-msft's avatar
    9 years ago

    jlum

     

    In this scenario, since you need to get the distinct count of event on each day and calculate average, I suggest you summarize a new table to with distict count calculated group on day level.

     

    Daily Events=
    SUMMARIZE (
        Table,
        Table[Date],
        "Daily Distinct Count Events", CALCULATE ( DISTINCTCOUNT ( Table[Events] ), ALLEXCEPT ( Table, Table[Date] ) )
    )

    Then you can calculate the moving average based on above calculated table.

     

     

    Regards,