Forum Discussion
Average Sales
- Anonymous4 years ago
Hi Anonymous ,
I agree with vapid128 's reply. I think your average is calcualted based on years and sales measure. I think sales measure should be created by SUM() function.
My Sample:
Measure:
Sales_ = SUM('Table'[Sales])Avg Sales = CALCULATE(AVERAGEX(VALUES('Calendar'[Fiscal Year]),[Sales_]))Result:
You see when I select 2022, I could only get average the same as the total in 2022. If you sum to calculate the sales, Power BI will take the same year as a whole.
What kind of result do you want? If you want to get 100 as average in 2022, please do not use sales measure.
Try this code.
Avg Sales = AVERAGEX('Table','Table'[Sales])Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
vapid128 Everything i select 2022, it give me the same as Total year instead of avg
Hi Anonymous ,
I agree with vapid128 's reply. I think your average is calcualted based on years and sales measure. I think sales measure should be created by SUM() function.
My Sample:
Measure:
Sales_ = SUM('Table'[Sales])Avg Sales =
CALCULATE(AVERAGEX(VALUES('Calendar'[Fiscal Year]),[Sales_]))
Result:
You see when I select 2022, I could only get average the same as the total in 2022. If you sum to calculate the sales, Power BI will take the same year as a whole.
What kind of result do you want? If you want to get 100 as average in 2022, please do not use sales measure.
Try this code.
Avg Sales =
AVERAGEX('Table','Table'[Sales])
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.