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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jmcph
Helper III
Helper III

what if to affect selected values only

Hi i am creating a table visual that uses "What if" analysis as follows: 

 

jmcph_0-1606706797475.png

 

What i want is for the Increase / Decrease on the Forecast Qty Value to affect only the selected Category and leave all other items belonging to other category as is. 

 

My Sales Qty Forecast measure is : 

 

Var SalesQty = Sum ( Sales[Qty])

Return 

 [SalesQty] * (1 * [Forecast Qty Value] )

 

Whereas the [Forecast Qty Value] is the default measure of the "What if" analysis. 

Forecast Qty Value = Selectedvalue ( Forecast Qty [ Forecast Qty] ,0) 

 

How should i formulate my measure to do this?

I hope you can help me! Thank you! 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jmcph , Make sure Category is an independent slicer

measure =
Var SalesQty = Sum ( Sales[Qty])
Return
calculate([SalesQty] * (1 * [Forecast Qty Value] ), filter(Table, Table[CATEGORY] = selectedvalue(CATEGORY[CATEGORY])))
+calculate([SalesQty], filter(Table, Table[CATEGORY] <> selectedvalue(CATEGORY[CATEGORY])))

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

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@jmcph , Make sure Category is an independent slicer

measure =
Var SalesQty = Sum ( Sales[Qty])
Return
calculate([SalesQty] * (1 * [Forecast Qty Value] ), filter(Table, Table[CATEGORY] = selectedvalue(CATEGORY[CATEGORY])))
+calculate([SalesQty], filter(Table, Table[CATEGORY] <> selectedvalue(CATEGORY[CATEGORY])))

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
Anonymous
Not applicable

What if you have an additional filter? 

 

For example, what if you only want to adjust the forecast for the selected category and for only a selected region, How would you do that?

Anonymous
Not applicable

Nevermind @amitchandak . I created a calculated table for that second filter and adjusted the formula below: calculate([SalesQty] * (1 * [Forecast Qty Value] ), filter(Table, Table[CATEGORY] = selectedvalue(CATEGORY[CATEGORY])))
+calculate([SalesQty], filter(Table, Table[CATEGORY] <> selectedvalue(CATEGORY[CATEGORY]) || Table[CATEGORY] <> selectedvalue(CATEGORY2[CATEGORY2])

Anonymous
Not applicable

Thank you so much! This was immensly helpful. 

Yeah! This totally works! I just didnt understand at first on what you mean by independent slicer. 

 

Thank you! 

Hi @amitchandak , what do you mean an independent slicer? 

 

I created a separate tab to test the measure you provided but it still shows the selected category only. 

 

jmcph_1-1606709327793.png

 

Where could i have gone wrong? Or i have misinterpreted the measure you gave. 

 

Still thank you for answering! 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.