Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

DAX Forecast Help (see attachment)

I need some help on creating a dax measurement. See attached sample data and with help needed. 

 

1 Reply

  • v-lili6-msft's avatar
    v-lili6-msft
    Icon for Community Support rankCommunity Support

    hi, Anonymous

    After my test, if remaining minths Oct/Noc/Dec is the rest months of the year? you may try this formula as below:

    new forecast = 
    IF (
        MAX ( Table2[Month] ) >= MONTH ( TODAY () ),
        DIVIDE (
            CALCULATE (
                [Variance],
                ALL ( Table2[Month Name], Table2[Month] ),
                Table2[Month] < MONTH ( TODAY () )
            ),
            12 - MONTH ( TODAY () )
                + 1
        )
    )

    Result:

    If you think about the year, you could create a year column and add the condition to the formula 

    new forecast = 
    IF (
        MAX ( Table2[Month] ) >= MONTH ( TODAY () )&& MAX ( Table2[Year] ) = Year ( TODAY () ),
        DIVIDE (
            CALCULATE (
                [Variance],
                ALL ( Table2[Month Name], Table2[Month] ),
                Table2[Month] < MONTH ( TODAY () ) && Table2[Year] = Year( TODAY () ) 
            ),
            12 - MONTH ( TODAY () )
                + 1
        )
    )

     here is pbix file, please try it.

    https://www.dropbox.com/s/pj2x49x98umrle8/DAX%20Forecast%20Help%20%28see%20attachment%29.pbix?dl=0

     

    Best Regards,

    Lin