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

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.

Reply
a0k08ac
New Member

Dynamic Text Box based on 2 slicers

Hello,

I have 2 slicers and the I want the result text box in such a way that if I select the first slicer and don't select any option from the second slicer, the text should be based on only the selected first slicer option. Now comes the complicated part where if I keep the selected first slicer option and then also select an option from the second slicer, the text should only display the value of the second slicer.

 

Example -

Slicer 1 options -> A,B,C,D

Slicer 2 options -> P,Q,R,S

 

If I select slicer 1 option A and don't select anything from slicer 2, result should be A

If I keep the slicer 1 as A and also select for example Q from slicer 2, result should be Q

 

One thing to note is that the slicer 1 is connected to slicer 2 in such a way that whenever I select any option from slicer 1, options are filtered for slicer 2.

 

I am having a hard time to design a DAX formula for this.

 

Thanks!

1 ACCEPTED SOLUTION
edhans
Super User
Super User

Something like this should work:

Text Measure =
VAR varFirstSlicer =
    SELECTEDVALUE( Table[Field] )
VAR varSecondSlicer =
    SELECTEDVALUE( Table[Field2] )
VAR Result =
    IF(
        ISBLANK( varSecondSlicer ),
        varFirstSlicer,
        varSecondSlicer
    )
RETURN
    Result

If the second slicer has anything but 1 value selected, you'll get the first slicer value.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

3 REPLIES 3
a0k08ac
New Member

It worked, thank you!

Awesome. SELECTEDVALUE() is one of my favorite functions. If you have 1 value selected it returns it. If you have 2+ or none selected, it returns blank.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
edhans
Super User
Super User

Something like this should work:

Text Measure =
VAR varFirstSlicer =
    SELECTEDVALUE( Table[Field] )
VAR varSecondSlicer =
    SELECTEDVALUE( Table[Field2] )
VAR Result =
    IF(
        ISBLANK( varSecondSlicer ),
        varFirstSlicer,
        varSecondSlicer
    )
RETURN
    Result

If the second slicer has anything but 1 value selected, you'll get the first slicer value.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.