Forum Discussion

ravi_ch's avatar
ravi_ch
Helper I
4 years ago
Solved

WHAT if parameter

 

here i created column chart using what if but 

if choosing 2019 and setting the value to rev - it also applying to all the years.

 

what i needed

If i select 2019 (year slicer) and set value using what if slicer - then it only applies to 2019

next if i select 2020( year slicer) and set different value then it only updates to 2020 column bar in chart

like that custimize column  chart

How can i create?

 

 

  • Hi ravi_ch 

     

    I checked your pbix. You put what-if parameter values in the column chart as Values fields. Do you want to select a year first and set two values in two what-if slicers, then select another year, set two what-if values, and so on for other four years? And finally you hope to see 12 different values in the column chart?

     

    If my understanding above is correct, I'm afraid this is not possible to be achieved with only two what-if slicers. When we change the value in a what-if slicer, its previous value will not be stored in the report. It will apply its current value to wherever it's used on the report page. Currently when you use what-if value as Values field, it's used on every column.  

     

    If you want to show 12 dynamic different values, you need 12 slicers to set values separately and two SWITCH measures to decide which value should be shown on each column. I created a simple sample for 2019 and 2020 in the attached pbix. 

     

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

3 Replies

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi ravi_ch 

     

    I checked your pbix. You put what-if parameter values in the column chart as Values fields. Do you want to select a year first and set two values in two what-if slicers, then select another year, set two what-if values, and so on for other four years? And finally you hope to see 12 different values in the column chart?

     

    If my understanding above is correct, I'm afraid this is not possible to be achieved with only two what-if slicers. When we change the value in a what-if slicer, its previous value will not be stored in the report. It will apply its current value to wherever it's used on the report page. Currently when you use what-if value as Values field, it's used on every column.  

     

    If you want to show 12 dynamic different values, you need 12 slicers to set values separately and two SWITCH measures to decide which value should be shown on each column. I created a simple sample for 2019 and 2020 in the attached pbix. 

     

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

  • ravi_ch , your year slicer also need to be an independent slicer, not joined to you table

     

    Then you can have new measure 

    New Measure  = Switch( True() ,

    max(Date[Year]) = selectedvalues(year[Year]) , [Measure] * selectedvalues(whatifrev[value]) ,

    [Measure]

    )

     

    here date is used on-axis and joined with fact table and year is an independent year table

     

    Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE