Forum Discussion
what if to affect selected values only
Hi i am creating a table visual that uses "What if" analysis as follows:
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!
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])))
6 Replies
- amitchandak
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])))- jmcph
Helper III
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.
Where could i have gone wrong? Or i have misinterpreted the measure you gave.
Still thank you for answering!
- jmcph
Helper III
Yeah! This totally works! I just didnt understand at first on what you mean by independent slicer.
Thank you!
- AnonymousNot applicable
Thank you so much! This was immensly helpful.