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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
ravi_ch
Frequent Visitor

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
Frequent Visitor

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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