Forum Discussion

fullcount's avatar
fullcount
Frequent Visitor
4 years ago
Solved

Auto-selecting from MAXX

Hello,   I have several forecast methods that predict outcomes with varying accuracy depending on the item.  I want to blend these into a single forecast measure, which will choose the method for e...
  • v-easonf-msft's avatar
    v-easonf-msft
    4 years ago

    Hi,  fullcount 

    In your second step, you can try calculated table formula as below:

     

    Calcualted table = 
    VAR M1 = [Measure1] // replace with your own measure formulas
    VAR M2 = [Measure2]  
    VAR M3 = [Measure3]
    VAR M4 = [Measure4]
    VAR tab1 =
        DATATABLE (
            "Forecast Method", STRING,
            {
                { "Method1" },
                { "Method2" },
                { "Method3" },
                { "Method4" }
            }
        )
    RETURN
        ADDCOLUMNS (
            tab1,
            "Measure column",
                SWITCH (
                    [Forecast Method],
                    "Method1", M1,
                    "Method2", M2,
                    "Method3", M3,
                    "Method4", M4
                )
        )

     

    Then you can apply your original measure normally:

     

    Optimized result = MAXX('Calcualted table','Calcualted table'[Measure column])

     

    Best Regards,
    Community Support Team _ Eason