cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

New Member

## Turning year to date sum to year to date average

Hi, I have a measure that sums the data year to date. I'm now looking to have an average year to date. This is my formula, is there anything I can do here to average instead of sum? Thanks very much.

YTD Sum = CALCULATE([Headcount Count Calc],DATESINPERIOD(data[Extract Date],max(data[Extract Date]), -12,MONTH))
1 ACCEPTED SOLUTION
Community Support

Hi @ashsandwich ,

I think you can use AVERAGE function. Here is the changed DAX codes.

``````YTD Average =
CALCULATE (
AVERAGE ( data[Headcount Count Calc] ),
DATESYTD ( data[Extract Date] )
)``````

If you want to learn more about AVERAGE function. I think you can read this document: AVERAGE function (DAX) - DAX | Microsoft Learn

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support

Hi @ashsandwich ,

I think you can use AVERAGE function. Here is the changed DAX codes.

``````YTD Average =
CALCULATE (
AVERAGE ( data[Headcount Count Calc] ),
DATESYTD ( data[Extract Date] )
)``````

If you want to learn more about AVERAGE function. I think you can read this document: AVERAGE function (DAX) - DAX | Microsoft Learn

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.