Skip to main content
cancel
Showing results for 
Search instead 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

Reply
ashsandwich
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
v-yilong-msft
Community Support
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.

View solution in original post

1 REPLY 1
v-yilong-msft
Community Support
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.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors