Avg over routes

I have created some measures to get the average routes of our DSPs per week.

for that I created:

  1. in order to get the total number of routes on daily level:
    → ifelse(sum(routes) > 0,
    sumOver(sum(routes),[{route_date},{station[ds_launches]},dsp]),0)

  2. in order to get the average routes on week level bvased on 1
    → avgOver({actuals_average_routes_0},[{route_week},{route_year},{station[ds_launches]},dsp])

however, in my table I can see the correct average when the day column is expanded, but when I collapse them into the week column, the average gets summed up. I want a table to show the average in the week column, not per day, otherwise it will repeat itself every day of the week.
in the example below, week 13 the average is the correct one. I want this value to be showing when I collapse the week column and not show it on the date column, it does not make sense.
see for instance week 12: it is colapsed and it summs up all values (I dont even know were the “910” comes from, but point is I dont want that number). the correct value that should show is 24 which is the exact value when I expand the week and see the day columns within the week.

question is: how do I avoid the values to change when I collapse the week column?

Hi @Alexandre_Kniepert,

Could you help with sample data

1 Like

I am not allowed to upload .csv here, how can I share with you?

@Alexandre_Kniepert Could you paste a screen shot of a couple rows of data?

1 Like

Hi Max,

apologize. I found the solution, just needed to adjust the measure.

Thank you

1 Like