Forum Discussion

jofoster's avatar
jofoster
Icon for Microsoft Employee rankMicrosoft Employee
7 years ago

Daily average across categories

Seems like this should be dead simple, but can't figure it out.   My data set has multiple values per day.  using the data set below, I want to be able to calculate the daily average by dayofweek  or isUserINternal or across both of those parameters.  Using a regular average, it seems to be treating each row as distinct, so in the below, it sees 7 rows, where I want it to be 3.  

 

Thanks

 

EventTimestampdayofweekIsUserInternalInteractionsPromptsResponses
Day1305831875120
Day 13110735415
Day 2409712947206
Day 24115746223
Day 24 010
Day 3508182698179
Day 35110534911

 

 

2 Replies

  • Hello jofoster 

    You just need to feed it the 3 rows you want it to average over like so:

    Avg Interations = AVERAGEX ( VALUES ( 'Table'[EventTimestamp] ), CALCULATE( SUM ( 'Table'[Interactions] ) ) )

    The VALUES ( 'Table'[EventTimestamp] ) returns a table that looks like this:

    Day 1
    Day 2
    Day 3

    Then the sum of the interations is calculated for each row of that table and finally the average is calculated.