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
ChristianRHouen
Helper III
Helper III

Moving average of a moving average measure

Dear community

 

I'm having issues with calculating the moving average of a percentage measure which is calculated on 2 moving average measures (that's right, a double moving average).

What I want is this:

ChristianRHouen_0-1611679084917.png

Also attached here: WeTransfer

 

Why?:
Ratio is a strategic KPI of ours. We want to measure the trend by comparing vs rolling 12m avg.

...



Rolling 12m = 
VAR pre6 =
    EDATE ( MAX ( DateTable[Date] ), -6 )
VAR cure =
    MAX ( DateTable[Date] )
RETURN
    CALCULATE (
        [RATIO],
        FILTER ( ALL ( DateTable ), DateTable[Date] >= pre6 && DateTable[Date] <= cure )
    )

 

 

Formulas I use to get the ratio (which are all working as intended):

6M Moving avg 1 = 
   VAR pre6 =
       EDATE ( MAX ( DateTable[Date] ), -6 )
   VAR cure =
       MAX ( DateTable[Date] )
var temp_table = FILTER(ALLSELECTED(ExtraLogic), ExtraLogic[date] >= pre6 && ExtraLogic[date] <=cure && ExtraLogic[DifferentDate] <= cure)
   RETURN
       SUMX(temp_table,ExtraLogic[“DATA1”]) 

6M Moving avg 2 = 
VAR pre6 =
    EDATE ( MAX ( DateTable[Date] ), -6 )
VAR cure =
    MAX ( DateTable[Date] )
RETURN
    CALCULATE (
        [“DATA 2”],
        FILTER ( ALL ( DateTable ), DateTable[Date] >= pre6 && DateTable[Date] <= cure )
    )


RATIO = IFERROR([6M Moving avg 1]/[6M Moving avg 2], BLANK())

 


Can I attach the data?
I would love to - however, it is confidential, so while I would be happy to sh...

1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data in usable format (not as a picture).

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.