Forum Discussion

Cmoore's avatar
Cmoore
Frequent Visitor
3 years ago
Solved

Cumulative run rate calculation

Hi,   I'm just in the process of trying to calculate forward looking forecasting using run rates. As it stands I have 6 months of actuals. I want to add the average monthly run rate on to the futur...
  • v-jingzhang's avatar
    3 years ago

    Hi Cmoore 

     

    You can create a new column with the following DAX instead of using Power Query. Ensure that Month Year column is of Date data type. Demo pbix has been attached at bottom. 

    Run Rate Cumulative = 
    VAR lastActualMonth =
        MAXX (
            FILTER ( 'Table', 'Table'[TY Actual Cumulative] <> BLANK () ),
            'Table'[Month Year]
        )
    RETURN
        SUMX (
            FILTER ( 'Table', 'Table'[Month Year] <= EARLIER ( 'Table'[Month Year] ) ),
            'Table'[Input Value TY]
        )
            + IF (
                ISBLANK ( 'Table'[Input Value TY] ),
                SUMX (
                    FILTER (
                        'Table',
                        'Table'[Month Year] > lastActualMonth
                            && 'Table'[Month Year] <= EARLIER ( 'Table'[Month Year] )
                    ),
                    'Table'[Avg. Monthly Run Rate]
                )
            )
    

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.