Forum Discussion

dc189's avatar
dc189
Helper II
9 years ago
Solved

Calculating average by year

Hello,   I have a simple dataset (https://www.dropbox.com/s/euehk38ihd5ki3h/Book1.xlsx?dl=0) with 3 columns - Year (column A), Sales per sq.ft. (Column B) and Average sales per sq.ft. (Column C). C...
  • v-huizhn-msft's avatar
    v-huizhn-msft
    9 years ago

    Hi dc189,

    There is no CALCULATED function in PowerBI, it should be CALCULATE.

    Why do you relate original table to a date table, you can create a calculated column in original table and get expected result.

    Yearly avg Sales per sq.ft. = CALCULATE(AVERAGE(Table3[Sales per sq.ft]),ALLEXCEPT(Table3,Table3[Year]))


    Please see the result in the following screenshot.



    Please let me know if you have any other questions.

    Best Regards,
    Angelia