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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Elisa_E
Helper I
Helper I

Dynamic text based on slicer

Hello,

 

I have a some string text I would like to include on top of a chart showing sales when certain a first slicer is selected. This first variable is "company". I managed to do this with a card and calculated column, however, I need the text to disappear when other filters are selected (e.g. "service type" and "region".). All slicers are columns and I'm not sure how to activate one and deactivate the others.

 

Thank you.

1 ACCEPTED SOLUTION

Hi @Elisa_E,

 

Could you try using the formula below to create a measure, then just show the measure on the Card visual(no need to apply it as visual level filter) to see if it work in your scenario?

Measure = 
IF (
    HASONEVALUE ( Table1[Region] ) || HASONEVALUE ( Table1[Service Type] ),
    "",
    IF (
        HASONEVALUE ( Table1[Company] ),
        FIRSTNONBLANK ( Table1[Dynamic text], 1 ),
        ""
    )
)

Remark: You'll need to replace Table1 with your real table name.

 

r2.PNGr3.PNG

 

Here is the sample pbix file for your reference. Smiley Happy

 

Regards

View solution in original post

4 REPLIES 4
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Elisa_E,

 

Based on my test, the formula below should work in your scenario. Smiley Happy

Measure =
IF (
    HASONEVALUE ( 'region'[region] ),
    FIRSTNONBLANK ( region[region], 1 ),
    IF (
        HASONEVALUE ( 'service type'[service type] ),
        FIRSTNONBLANK ( 'service type'[service type], 1 ),
        IF (
            HASONEVALUE ( 'company'[company] ),
            FIRSTNONBLANK ( 'company'['company'], 1 )
        )
    )
)

Remark: You'll need to replace the bold with your real table name and column name.

 

Regards

Hi @v-ljerr-msft,

 

Thanks for this! I tried this measure as a visual filter, (show items if = 1), but then the visual then won't show at all, so I'm likely doing something wrong.

What I am trying to do is show text (from the dynamic text column below) only when Company A or B is selected in a slicer. I've managed this with a card. However, I need this text to disappear when a specific region or service type is selected. Not sure if this is possible.

 

Thanks again.

 

dynamic text.png

Hi @Elisa_E,

 

Could you try using the formula below to create a measure, then just show the measure on the Card visual(no need to apply it as visual level filter) to see if it work in your scenario?

Measure = 
IF (
    HASONEVALUE ( Table1[Region] ) || HASONEVALUE ( Table1[Service Type] ),
    "",
    IF (
        HASONEVALUE ( Table1[Company] ),
        FIRSTNONBLANK ( Table1[Dynamic text], 1 ),
        ""
    )
)

Remark: You'll need to replace Table1 with your real table name.

 

r2.PNGr3.PNG

 

Here is the sample pbix file for your reference. Smiley Happy

 

Regards

This works perfectly! Thank you so much!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.