Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

IF STATEMENT USING SELECTED VALUE

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 ! 🙂 

1 ACCEPTED SOLUTION
PaulOlding
Solution Sage
Solution Sage

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
    )

View solution in original post

3 REPLIES 3
PaulOlding
Solution Sage
Solution Sage

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
    )
Anonymous
Not applicable

Hi @PaulOlding ,

 

Thank you so much!

bcdobbs
Community Champion
Community Champion

You certainly can!

 

Have a look at this example:

https://www.pbiusergroup.com/communities/community-home/digestviewer/viewthread?MessageKey=b52f0351-...



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.