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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

PowerBI - DAX : 12Month Rolling Average formula not working accurately

Hi Team,

 

I have created a DAX measure to calculate the 12 Month Rolling Average. The results looks very strange. The DAX measure works correctly only for certain months. 

The calculation starts from the Month 2020, Jan.  Till 2021, May the calculation works correctly and producing the expected results.

After 2021, May - The calculation does not produce accurate results. Its not returning 12 Month Average, the results are volatile. Please refer the attached excel sheet.

The measure I am using for calculating 12 Month Average is :

 

M22_12M Average to Case Resolution =
VAR LastDateinPeriod=MAX('Ref.Date'[Date])
Var FirstCaseinPeriod=NOT(ISEMPTY(FILTER(ALL('111_BLP_NewCases'),'111_BLP_NewCases'[Date]<LastDateinPeriod)))
Var LastCaseinPeriod=NOT(ISEMPTY(FILTER(ALL('111_BLP_NewCases'),'111_BLP_NewCases'[Date]>LastDateinPeriod)))
 F(NOT(ISBLANK(_12MAvegResolutioninPeriod)),_12MAvegResolutioninPeriod,IF(AND(FirstCaseinPeriod,LastCaseinPeriod),0))
---------------------------------------------------------------------------------------------------------------------------------------------- 
M21_3M_Avergae time to Case Resolution =
Var LastDateinPeriod=MAX('Ref.Date'[Date])
Var FirstCaseinPeriod=NOT(ISEMPTY(FILTER(ALL('111_BLP_NewCases'),'111_BLP_NewCases'[Date]<LastDateinPeriod)))
Var LastCaseinPeriod=NOT(ISEMPTY(FILTER(ALL('111_BLP_NewCases'),'111_BLP_NewCases'[Date]>LastDateinPeriod)))
Var _AvgTimeToResolution=([M20_3M_Sum of closed plus resolved case Age]/[M18_3M_count of closed and resolved cases])
Return
IF(NOT(ISBLANK(_AvgTimeToResolution)),_AvgTimeToResolution,IF(AND(FirstCaseinPeriod,LastCaseinPeriod),0))

------------------------------------------------------------------------------------------------------------------------------------------------

YearMonthM21_3M_Avergae time to Case ResolutionM22_12M Average to Case ResolutionMonth
2020January000
2020February000
2020March000
2020April000
2020May000
2020June71.1666666676
2020July43.67.2285714297
2020August142.7824.17258
2020September159.7539.236666679
2020October266.7561.98810
2020November805129.534545511
2020December50.34122.93512
2021January34.77125.832512
2021February44.25129.5212
2021March53.11133.945833312
2021April60.81139.013333312
2021May61.89144.170833312
2021June59.86150.752511.82673588
2021July54.68168.746666710.63126185
2021August52.17106.406666716.00820751
2021September57.51111.199166714.39884891
2021October62.29116.3912
2021November61.752.5433333312.43506947
2021December55.1154.4391666712.08964134
2022January55.8258.1411.68214654
2022February57.9458.387511.86709484
2022March58.6958.6208333311.91504727
2022April54.3457.4712.0410649
2022May52.1956.0916666712.16401723
2022June51.7455.482512.15121885
2022July53.9456.607511.8966568
2022August51.0257.1608333311.76137507
2022September48.5755.1433333312.02955933
2022October41.9552.452512.25890091
2022November39.1651.3783333312.07649139
2022December35.8251.4808333311.67774414
2023January32.9547.93512.06446229
2023February28.1644.95512.20175731
2023March21.3242.502512.02658667
2023April17.7939.4941666712.01721773
2023May12.8136.2316666712.01242007
2023June1.232.642511.78494294
3 REPLIES 3
Anonymous
Not applicable

Hi, Thanks for your reply. The file is loaded with many tables already max - 80 tables. Also the file is having some sensitive information. I am sorry, I am unable to share the file.

Alright, best of luck with your problem. 🙂




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Wilson_
Super User
Super User

Hello,

 

Can you please provide your pbix (or at least a sample version)?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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