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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Sania-F
Resolver I
Resolver I

Hide part of text in text box based on value selected in slicer

HI All,

 

I have a size slicer. I have a text box with below static text and dynamically inserted values.

Net at []-30%

  • bucket size:">1M" bucket at []+10% , with india as outlier, " >100k -1M" bucket at net []+0.0% and "<100k" bucket at net []-20%.

Slicer has 3 values >1M, <100K, >100k-1M. 
Whenever  >1M is selected in slicer, the text part related to other 2 values should get hidden. 
Whenever  <100K is selected in slicer, the text part related to other 2 values should get hidden. 
Whenever  >100K- 1M is selected in slicer, the text part related to other 2 values should get hidden. 
Whenever any 2 values are selected , text part related to those 2 values should be visible and the other text part should hide.

1 ACCEPTED SOLUTION
Sania-F
Resolver I
Resolver I

after going crazy for a whole day, found a work around, thats a bit tedious.

1. dax To show text dynamically for bucket 1

bucket >1M Text1 =

VAR SelectedSize = SELECTEDVALUE(DimBucket[Size])

var a =IF(CONTAINSSTRING(

    CONCATENATEX(

        ALLSELECTED(DimBucket[Size]),DimBucket[Size],","),">1M"),

"True","False"

)

RETURN

--a

IF(

    a="True",

    "'>1M' bucket at ", --space is mandatory after "at" as I dont want to hard code space inside textbox.

    BLANK()

)

 

 

 

=======

 

2. Dax to fetch Positive values(to color it in green manually in text box)

bucket green >1M No =

VAR SelectedSize = SELECTEDVALUE(DimBucket[Size])

var a =IF(CONTAINSSTRING(

    CONCATENATEX(

        ALLSELECTED(DimBucket[Size]),DimBucket[Size],","),">1M"),

"True","False"

)

RETURN

--a

IF(

    a="True",

    if(

        [size%] > 0,CONCATENATE("+", FORMAT([size %], "0.0%")) ,blank()

            ),

    BLANK()

)

 

===========

3. DAX to fetch negative values(to be colored in red manually)

 

bucket % red >1M = 

VAR SelectedSize = SELECTEDVALUE(DimBucket[Size])

var a =IF(CONTAINSSTRING(

    CONCATENATEX(

        ALLSELECTED(DimBucket[Size],DimBucket[Size],","),">1M"),

"True","False"

)

RETURN

--a

IF(

    a="True",

    if(

        [size %] < 0, [size %] ,blank()

            ),

    BLANK()

)



So I had to create n no. of measures to show/hide text and numbers dynamically in text box as per slicer selection for each bucket(<100k, 100k-1M, >1M).

My text box is now made of all inserted values.

anyone has any better idea, let me  know.

thankyou.

View solution in original post

1 REPLY 1
Sania-F
Resolver I
Resolver I

after going crazy for a whole day, found a work around, thats a bit tedious.

1. dax To show text dynamically for bucket 1

bucket >1M Text1 =

VAR SelectedSize = SELECTEDVALUE(DimBucket[Size])

var a =IF(CONTAINSSTRING(

    CONCATENATEX(

        ALLSELECTED(DimBucket[Size]),DimBucket[Size],","),">1M"),

"True","False"

)

RETURN

--a

IF(

    a="True",

    "'>1M' bucket at ", --space is mandatory after "at" as I dont want to hard code space inside textbox.

    BLANK()

)

 

 

 

=======

 

2. Dax to fetch Positive values(to color it in green manually in text box)

bucket green >1M No =

VAR SelectedSize = SELECTEDVALUE(DimBucket[Size])

var a =IF(CONTAINSSTRING(

    CONCATENATEX(

        ALLSELECTED(DimBucket[Size]),DimBucket[Size],","),">1M"),

"True","False"

)

RETURN

--a

IF(

    a="True",

    if(

        [size%] > 0,CONCATENATE("+", FORMAT([size %], "0.0%")) ,blank()

            ),

    BLANK()

)

 

===========

3. DAX to fetch negative values(to be colored in red manually)

 

bucket % red >1M = 

VAR SelectedSize = SELECTEDVALUE(DimBucket[Size])

var a =IF(CONTAINSSTRING(

    CONCATENATEX(

        ALLSELECTED(DimBucket[Size],DimBucket[Size],","),">1M"),

"True","False"

)

RETURN

--a

IF(

    a="True",

    if(

        [size %] < 0, [size %] ,blank()

            ),

    BLANK()

)



So I had to create n no. of measures to show/hide text and numbers dynamically in text box as per slicer selection for each bucket(<100k, 100k-1M, >1M).

My text box is now made of all inserted values.

anyone has any better idea, let me  know.

thankyou.

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors