Forum Discussion
HELPME_JFLO
3 years agoNew Member
Switch Formula on Multiple Selection on Slicer?
Hi All, I have a what I think, a pretty simple model/ask I am asking of Power BI (I think), and still can't figure out what I'm doing wrong. I have one fact table and a product line (catego...
FreemanZ
Super User
3 years agohi HELPME_JFLO
at least first try like:
VAR selection_lowest = SELECTEDVALUE ( 'Product Line Filter'[Lowest] )
//var SALES_GAL = [9775 - SALES_GAL]
//var SALES_LBS = [9380 - SALES_LBS]
//var SALES_LBS_ETH = [16034 - SALES_LBS_ETHYLENE]
var A = CALCULATE([9775 - SALES_GAL], FILTER('Product Line Filter',[Lowest] = "A"))
var B = CALCULATE([16034 - SALES_LBS_ETHYLENE], FILTER('Product Line Filter',[Lowest] = "B"))
return
switch(
true(),
selection_lowest = "A", A,
selection_lowest = "B", B,
selection_lowest in {"A","B"}, A + B,
0 )
Hard to believe, but variables in DAX are actually constant values.
HELPME_JFLO
3 years agoNew Member
Thanks for trying, but regardless of the variables it still produced the same output as original 😞