Forum Discussion

Jorgast's avatar
Jorgast
Resolver II
7 years ago
Solved

Division in a Measure

Hello BI Community,   I am trying to get an average of sales offered for 2018 and 2019 by week and have that average be constant in a line/bar chart. I have a date table setup where i have the week...
  • Cmcmahan's avatar
    7 years ago

    It looks like you're getting the correct numerator value because you're using the ALLEXCEPT to change the filter context, but you're not doing the same for the denominator. 

     

    Try this so that you're applying the same context changes to both halves of the equation:

    Avg Sales2018 = CALCULATE(sum('Sample Data'[Sales_Offered])/[Count of WeekNum], "2018", ALLEXCEPT(Dates, Dates[Date]))