Forum Discussion

WEARLE's avatar
WEARLE
Frequent Visitor
2 years ago
Solved

Average Percentage Change over time

Hiya

 

I am trying to calculate the average percentage change of a task type over time. I have a measure to sum up the task type amount, a measure to calute the task total the MoM and a month on month measure calculating the percentage change MoM. How would i go about geting the average of the percentage change over the time of the data set ( since Jan 22)

The measure to calc the MoM%change is 

TasktypeMoM % =
VAR _prev =
        IF(
            NOT(ISBLANK([TaskType])),
            CALCULATE(
            [TaskType],
            PREVIOUSMONTH(dimDate[Date])
        ))
RETURN
DIVIDE((TaskType]-_prev),_prev)

 

I have a date table called dimDate, the tasktypoe is a name within a column called "Task Name" in the table...

Any help would be great and appreciated!

Thanks

  • Hi,

    Try this measure

    Measure = AVERAGEX(SUMMARIZE(CALCULATETABLE(CALENDAR,DATESBETWEEN(CALENDAR[DATE],MINX(ALL(CALENDAR),CALENDAR[DATE]),MAX(CALENDAR[DATE]))),CALENDAR[YEAR MONTH],"A',[MON%CHANGE]),[A])

    Hope this helps.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi WEARLE ,

    Please try this DAX:

    Average TaskTypeMoM % Change = 
    AVERAGEX(
        FILTER(
            ALLSELECTED(dimDate[Date]),
            dimDate[Date] >= DATE(2022, 1, 1) && NOT ISBLANK([TasktypeMoM %])
        ),
        [TasktypeMoM %]
    )

    If it doesn't work, can you provide some sample data and show the relationships between tables.

    Best Regards,
    Dino Tao
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Hi,

    Try this measure

    Measure = AVERAGEX(SUMMARIZE(CALCULATETABLE(CALENDAR,DATESBETWEEN(CALENDAR[DATE],MINX(ALL(CALENDAR),CALENDAR[DATE]),MAX(CALENDAR[DATE]))),CALENDAR[YEAR MONTH],"A',[MON%CHANGE]),[A])

    Hope this helps.