Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 @jvm
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 @jvm
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |