Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I've been trying to do something that looks simple but still couldn't find any answers to:
I have 2 columns A and B and I'm calculating a measure using both. What should I do if I wanted the user to be able to click a button (or buttons) to make it possible for the measure to be computed for different scenarios according to the button selected, e.g. using:
- only the values of column A or
- only the values of column B or
- both columns
Thank you in advance!
Solved! Go to Solution.
Hi @Anonymous
You can create a slicer with the options. A one-column table:
SlicerTable
Option 1
Option 2
Option 3
The user can then select the option in the slicer. Your measure would read the contents of the slicer and perfomr the required calculation based on it. Something like:
Measure =
SWITCH (
SELECTEDVALUE ( SlicerTable[Option] ),
"Option 1", SUM(Table1[Col A]),
"Option 2", SUM(Table1[Col B]),
"Option 3", SUM(Table1[Col A]) + SUM(Table1[Col B])
)
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi @Anonymous
You can create a slicer with the options. A one-column table:
SlicerTable
Option 1
Option 2
Option 3
The user can then select the option in the slicer. Your measure would read the contents of the slicer and perfomr the required calculation based on it. Something like:
Measure =
SWITCH (
SELECTEDVALUE ( SlicerTable[Option] ),
"Option 1", SUM(Table1[Col A]),
"Option 2", SUM(Table1[Col B]),
"Option 3", SUM(Table1[Col A]) + SUM(Table1[Col B])
)
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
User | Count |
---|---|
98 | |
76 | |
75 | |
48 | |
27 |