Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Rolling Average FYTD

Hi Community. Looking for some help with the below measure code.

 

I'm trying to return the FYTD for the months which have elapsed in this current financial year to date.
Currently, the measure is summing up the average for each month and then  returning the total. However i want the measure to acknowledge that only 2 months of the financial year have passed and calculate the average based on the total average (the sum of the average per month)/2 (the months elapsed this financial year, excluding current month).

 

Can anyone recommend how i can upgrade this measure to meet that need?

Average Days per Personrolling average FY Month = 
IF(
	ISFILTERED('Calendar (DAX)'[Date]),
	VAR _LAST_DATE = ENDOFMONTH('Calendar (DAX)'[Date])
	VAR _DATE_PERIOD =  
		DATESBETWEEN(
			'Calendar (DAX)'[Date],
			STARTOFMONTH(DATEADD(_LAST_DATE, -12, MONTH)),
			ENDOFMONTH(DATEADD(_LAST_DATE, 1, MONTH))
		)
	RETURN
		AVERAGEX(
			CALCULATETABLE(
				SUMMARIZE(
					VALUES('Calendar (DAX)'),
					'Calendar (DAX)'[FiscalYear]
                    , 'Calendar (DAX)'[date]
				),
				_DATE_PERIOD
			),
			CALCULATE([Average Days per Person], ALL('Calendar (DAX)'[Date]))
		)
)

6 Replies

  • Hi,

    Share some data and show the expected result.  Also, please clarify when does your Financial Year start

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi there


      Thanks for the reply. The financial year begins 01 July 2019.  The Rolling average column in the below is the execpted result. 

       

      Financial YearFinancial Year MonthFinancial Year Month NumberAverage Days per PersonPeopleDaysRolling Average
      2020July11.0506115462452.82576.941.050611546
      2020August20.6805040712444.11663.221.390863582
      2020September30 0 
      2020October40 0 
      2020November50 0 
      2020December60 0 
      2020January70 0 
      2020February80 0 
      2020March90 0 
      2020April100 0 
      2020May110 0 
      2020June120 0

       

       

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Hi,

        How did you calculate the Rolling average of August as 1.390863582?  Please elaborate.  Also, share the link from where i can download your PBI file.