Forum Discussion
Calculate the variance between two (variable) selections
For dynamic variance between two slicer-selected values, the DAX pattern uses SELECTEDVALUE with a disconnected table:
Variance =
VAR _sel1 = CALCULATE([Amount], 'Type'[Type] = SELECTEDVALUE(Slicer1[Type]))
VAR _sel2 = CALCULATE([Amount], 'Type'[Type] = SELECTEDVALUE(Slicer2[Type]))
RETURN _sel1 - _sel2
This requires two separate single-select slicers (one per selection). If users need to pick from the same list, you need a disconnected parameter table with two separate What-If parameters one for each selection slot.
The complexity grows quickly if you have multiple metrics or need the variance to work across a hierarchy drill-down.
For this exact use case users picking any two scenarios to compare and seeing variance automatically Flexa Tables on AppSource removes the DAX entirely. Users select the two comparison periods directly in the published report, variance columns appear instantly across all metrics. Particularly clean for LBE vs Actuals or Budget vs Forecast type comparisons