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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ravi_ch
Helper I
Helper I

WHAT if parameter

ravi_ch_1-1636493360121.png

 

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?

 

 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
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.

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
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
Helper I
Helper I

https://1drv.ms/u/s!AmGs-otaqYSLh1v25JpB299k4tzb

 

here is link of pbix file

sir, your code not working

can you try on PBI file sir

amitchandak
Super User
Super User

@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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors