Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Phil_SPR
Frequent Visitor

YTD and Rolling average

HI, 

Newly learning my way around so hope someone can help! I am trying to calculate the YTD average of meetings held per week and also show thew rolling average in a bar/line chart visual.

Ive used the following code but am running into issues as the average is being calculated across the numbers of staff each week as opposed to the total for the week.  for example week 9 in the table is being calculated as an average of 2. it's also giving unexpected results in the chart for the same reason, if I filter it to just one team member then it is giving an expected result.

Screen Shot 2022-10-06 at 5.12.15 pm.png

The measure I am using is; 

Average DAs PW = AVERAGEX(FILTER(ALLSELECTED(Append1),Append1[Week Number]<=MAX(Append1[Week Number])),Append1[DAs])
 
cheers for any help!

2 REPLIES 2
amitchandak
Super User
Super User

@Phil_SPR , Please create week/Date dimension table and join it with your table on week/date and then try a measure like

 

Average DAs PW = calculate(AVERAGE(Append1[DAs]), FILTER(ALLSELECTED(Week),Week[Week Number]<=MAX(Week[Week Number])))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thanks for the response, unfortunatly this is giving me the same result.

The issue is that there are anywhere from 2 to 6 advisers taking DAs in any given week and the formula is dividing the weekly DA total between the advisors. Not giving a weekly average of the total.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.