DAX-AverageX

Hello Friends,

I have expression as below.In year level it shows me average of yearly sales.but in week level,it shows me same value as sales.how is it possible ? I thought when week level there is only one year in the filter context.so it should have given yearly value ? what do i miss here ?  I am now a litte confused filter context again.

AverageSalesOverYears:=AVERAGEX(ALLSELECTED(DimDate[CalendarYear]),[Sales])

February 13th, 2015 4:50am

If you want the average to be only over the date range selected instead of the entire year, then your formula should be just AVERAGE([Sales]). The average will calculate dynamically based on date relationship (which should be at lowest possible granularity).
  • Proposed as answer by SqlBIGuyMN 20 hours 14 minutes ago
Free Windows Admin Tool Kit Click here and download it now
February 13th, 2015 10:15am

so what is the point here.In week level this ALLSELECTED(DimDate[CalendarYear]) will return null  and then ?
February 13th, 2015 5:22pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics