Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Andshepch
Advocate II
Advocate II

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

1 ACCEPTED SOLUTION

Hi, @Andshepch 

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]

 

19.png

 

 

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.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Andshepch , You need to create measures like

 

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

 

 

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

Hi, @Andshepch 

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]

 

19.png

 

 

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.

Fantastic! This does exactly what I was trying to do. Thank you so much.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors