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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

HELP NEEDED: Display average of the Last Twelve Months

Dear community, 

 

I am struggeling to calculate the average of the last twelve months. In the Table the amount of employees are shown for each month. 

 

My DAX formula currently is: 

Employees Average LTM = CALCULATE(AVERAGE(Facts[Value]), AccountStructure[AccountLevel1]="6-3 Personal",AccountStructure[AccountLevel2]="Mitarbeiter",AccountStructure[AccountLevel3]="Mitarbeiter - Übersicht", AdjustmentLevel[AdjustmentLevelName]= "Controlling", DATESINPERIOD(Period[Date_complete], MAX(Period[Date_complete]),12,MONTH))
 
Sadly, the value shown is completely off, as it should be around 5.989 and it shows me 35.
 
Kind regards
Nick 

 

4 REPLIES 4
Anonymous
Not applicable

Similar Problem with another DAX. 

 

The number is so close but still not right and I don't get why. Should be something around 260 but is 287

 

DAX: 

Personalkosten (inkl. Leiharbeit) LTM AVERAGE = - CALCULATE(AVERAGEX(VALUES(Period[Month]), calculate(sum(Facts[Value]), AccountStructure[AccountLevel1]="Kennzahlen IFRS", AccountStructure[AccountLevel2]="Kennzahlen zur Ertragslage",AccountStructure[AccountLevel3]="LTM Personalkosten (inkl. Leiharbeit)", AdjustmentLevel[AdjustmentLevelName]= "IFRS Konzernabschluss", DataLevel[DataLevelName]= "IST")), DATESINPERIOD(Period[Date_complete],today(),-12,MONTH))
Anonymous
Not applicable

@Shaurya @Greg_Deckler @PaulDBrown @Jihwan_Kim 

Does any of you have a guess what I am doing wrong?

amitchandak
Super User
Super User

@Anonymous , Try a measure like

12 Month Avg = CALCULATE(AverageX(Values('Date'[MONTH Year]),calculate(Sum('Table'[Value)))
,DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH))

 

or check

Average of Rolling, Average of Snapshots: https://youtu.be/_pZRdLAJxxA

Anonymous
Not applicable

Sadly, I still receive the wrong numbers. Now 23,83 thousand 😕 

 

DAX is as following: 

 
Employees Average LTM = CALCULATE(AVERAGEX(VALUES(Period[Month]), calculate(sum(Facts[Value]), AccountStructure[AccountLevel1]="6-3 Personal", AccountStructure[AccountLevel2]="Mitarbeiter",AccountStructure[AccountLevel3]="Mitarbeiter - Übersicht", AdjustmentLevel[AdjustmentLevelName]= "Controlling")), DATESINPERIOD(Period[Date_complete], MAX(Period[Month]),-12,MONTH))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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