DAX code
Total Sales (Toggle Switch) =
VAR ShowMeasure = SELECTEDVALUE('Toggle'[ToggleValue], 1) -- 1 = on, 0 = off
RETURN
IF(ShowMeasure = 1, [Total Sales], BLANK())
Shows or hides a measure's value based on a disconnected slicer, letting report users turn a visual's data on or off.
Type your table and column names once. Every measure below updates.
Total Sales (Toggle Switch) =
VAR ShowMeasure = SELECTEDVALUE('Toggle'[ToggleValue], 1) -- 1 = on, 0 = off
RETURN
IF(ShowMeasure = 1, [Total Sales], BLANK())
Requires a small disconnected 'Toggle' table (e.g. two rows: On = 1, Off = 0) with ToggleValue bound to a slicer.
Browse all 175 measures in the Power BI DAX Measures Library, or search the library for something similar to Total Sales (Toggle Switch).