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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Guys,
Newbie here,
I would like to know if is it possible to use SELECTEDVALUE function in an IF STATEMENT as a measure.
For Example.
I want to use different MEASURE depending on the SELECTEDVALUE of a slicer.
Thank you so much for your help ! 🙂
Solved! Go to Solution.
Hi @Anonymous
Yes, you can do that. You'll probably want to use SWITCH though, to avoid lots of nested IFs.
Something like
Selected Measure =
SWITCH(
SELECTEDVALUE(Table[Slicer Column]),
"Slicer Value 1", [Measure 1],
"Slicer Value 2", [Measure 2],
..... etc
)
Hi @Anonymous
Yes, you can do that. You'll probably want to use SWITCH though, to avoid lots of nested IFs.
Something like
Selected Measure =
SWITCH(
SELECTEDVALUE(Table[Slicer Column]),
"Slicer Value 1", [Measure 1],
"Slicer Value 2", [Measure 2],
..... etc
)
You certainly can!
Have a look at this example:
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |