Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

What if parameters help please

Hi all,

 

I have a sales forecast table by country that I would like to be able to combine with What If parameters, so that the Global head of sales can calculate the results if individual countries increased their sales e.g. 

CountrySales ForecastSales IncreaseTotal
USA10010110
UK90999
Canada801595
France701282

 

What I would like is that the Sales Increase value can be entered using a What If parameter that the Global head can change dynamically for each country

 

I would greatly appreciate any/all help that you can give.

 

Thanks

 

Andrew

  • Hi, Anonymous 

    Try measure as below after you have created 4 seperate What If measures.  

    Sales Increase = 
    SWITCH (
        SELECTEDVALUE ( 'Table'[Country] ),
        "USA", 'Parameter USA'[Parameter USA Value],
        "UK", 'Parameter UK'[Parameter UK Value],
        "Canada", 'Parameter Canada'[Parameter Canada Value],
        "France", 'Parameter France'[Parameter France Value]
    )
    Sales Increase2 =
    SUMX ( VALUES ( 'Table'[Country] ), [Sales Increase] )
    
    Total =
    SELECTEDVALUE ( 'Table'[Sales Forecast] ) + [Sales Increase2]

     

     

     

    Best Regards,
    Community Support Team _ Eason
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • Anonymous , You need to create measures like

     

    measure =
    var _sel = selectedvalue(whatif[value])
    return
    sumx(filter(values(Country[Country]), [Sales] >_sel ),[sales])

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi, and thank you very much for your reply.

       

      I have created a measure using your formula above and when I try to add it to my table it applies the measure to all the countries. What I am trying to do is have 4 seperate What If measures - 1 per country, so that the table will have Country X Forecast + Country X Parameter, Country Y Forecast + Country Y Parameter etc. and show them on one Table visualisation.

       

      I don't know if this is possible but I would appreciate your help.

       

      Thanks again.

       

      Andrew

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

        Hi, Anonymous 

        Try measure as below after you have created 4 seperate What If measures.  

        Sales Increase = 
        SWITCH (
            SELECTEDVALUE ( 'Table'[Country] ),
            "USA", 'Parameter USA'[Parameter USA Value],
            "UK", 'Parameter UK'[Parameter UK Value],
            "Canada", 'Parameter Canada'[Parameter Canada Value],
            "France", 'Parameter France'[Parameter France Value]
        )
        Sales Increase2 =
        SUMX ( VALUES ( 'Table'[Country] ), [Sales Increase] )
        
        Total =
        SELECTEDVALUE ( 'Table'[Sales Forecast] ) + [Sales Increase2]

         

         

         

        Best Regards,
        Community Support Team _ Eason
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.