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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Sania-F
Resolver I
Resolver I

hide complete text or partial text in textbox based on certain conditions

So, I had 2 requirements

 

1. If only one value is selected in slicer, Hide  all sentences that I had.

I had slicer called - Bucket. bucket values->  10M,20M,30M 

 

2. Show/hide complete or partial text in text box based on certain conditions.

 

-if country and industry both are not blank, show values for both 

-if country is blank, show industry values

-if industry both is blank, show country values  

- if country and industry both are blank, show blank

1 ACCEPTED SOLUTION
Sania-F
Resolver I
Resolver I

Hi,

 

So here whats I Implemented.

 

rev_Across_country_Industry_JoinTbl =

    var Bucket_Filter= HASONEFILTER(Bucket_Filter[Bucket])

    VAR Country_Industry =

        CONCATENATEX(

            FILTER(

                VALUES( Country_Industry_CrossJoin[Country_Industry]),

                [Rev] < -20 &&

                [Rev%] < -0.06

            ),

            Country_Industry_CrossJoin[Country_Industry],

            ", "

        )

    VAR VIP_client=

         CONCATENATEX (

        FILTER (

            Client,

            client[Clientid] IN { 2,3 } &&

            [Rev] < -20 &&

            [Rev%] < -0.06

        ),

       client[clientName],

        ", "

    ) --& " account"

    RETURN

        --COuntry_industry

    if(HASONEFILTER(DimBucket[Bucket]), blank(),

         IF (

            NOT ISBLANK(Country_Industry) && NOT ISBLANK(VIP_client),

            "• Requiring attention country and industry " & Country_Industry & ", as well as the " & VIP_client & " account",

                if(NOT ISBLANK(Country_Industry) &&  ISBLANK(VIP_client),

                "• Requiring attention are/is the Country_Industry " & Country_Industry,

                    if(ISBLANK(Country_Industry) && NOT  ISBLANK(VIP_client),  "• Requiring attention are/is the " & VIP_client & " account",blank() )

                    )

           

        )

       

)



HASONEFILTER => to hide all sentences
if conditions placed within one another carefully as the way I wanted them to be evaluated. If not placed properly they wont function as expected.

View solution in original post

2 REPLIES 2
Sania-F
Resolver I
Resolver I

Hi,

 

So here whats I Implemented.

 

rev_Across_country_Industry_JoinTbl =

    var Bucket_Filter= HASONEFILTER(Bucket_Filter[Bucket])

    VAR Country_Industry =

        CONCATENATEX(

            FILTER(

                VALUES( Country_Industry_CrossJoin[Country_Industry]),

                [Rev] < -20 &&

                [Rev%] < -0.06

            ),

            Country_Industry_CrossJoin[Country_Industry],

            ", "

        )

    VAR VIP_client=

         CONCATENATEX (

        FILTER (

            Client,

            client[Clientid] IN { 2,3 } &&

            [Rev] < -20 &&

            [Rev%] < -0.06

        ),

       client[clientName],

        ", "

    ) --& " account"

    RETURN

        --COuntry_industry

    if(HASONEFILTER(DimBucket[Bucket]), blank(),

         IF (

            NOT ISBLANK(Country_Industry) && NOT ISBLANK(VIP_client),

            "• Requiring attention country and industry " & Country_Industry & ", as well as the " & VIP_client & " account",

                if(NOT ISBLANK(Country_Industry) &&  ISBLANK(VIP_client),

                "• Requiring attention are/is the Country_Industry " & Country_Industry,

                    if(ISBLANK(Country_Industry) && NOT  ISBLANK(VIP_client),  "• Requiring attention are/is the " & VIP_client & " account",blank() )

                    )

           

        )

       

)



HASONEFILTER => to hide all sentences
if conditions placed within one another carefully as the way I wanted them to be evaluated. If not placed properly they wont function as expected.

amitchandak
Super User
Super User

@Sania-F , Create one or more measure like this and use in text box

 

If(isfiltered(Table[Country]) && isfiltered(Table[Industry]) , [Bucket Value measure], blank())

 

or

 

If(not(Isblank(Max(Table[Country]))) && not(Isblank(Max(Table[Industry]))) , [Bucket Value measure], blank())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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