Forum Discussion
Calculating average by year
- 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
Hi dc189,
I am very gald you have resolved your issue, please mark the helpful reply as answer, which will help more people.
Best Regards,
Angelia
Hello v-huizhn-msft,
I also need to create a dashboard with direct query connection (not import connection). The problem is the Calculate function you suggested does not work with direct query. Is there an alternative function to Calculate so I can calculate the yearly average sales per sq.ft? Or can you make Calculate work with direct query?
Thanks,
dc189