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

Current Selection Based on the Filter Selection

Hi All,

 

This is my current selection dax.

 

_Current Selection =

VAR _Country = IF( ISFILTERED( CLINIC[country] ),
                    "COUNTRY - " & CONCATENATEX(DISTINCT( CLINIC[country] ),
                                    CLINIC[country],", ", CLINIC[country], ASC ) )

VAR _Product = IF( ISFILTERED( CAREPLAN[Product] ),
                    "PRODUCT - " & CONCATENATEX(DISTINCT( CAREPLAN[Product] ),
                                    CAREPLAN[Product],", ", CAREPLAN[Product], ASC ) )

RETURN

_Country & " | " & _Product

 

Without any selection the pipeline symbol should not be displayed.

 

nanbandinesh19_0-1709968152480.png

Thanks in advance.

 

1 ACCEPTED SOLUTION

Hi,

Please try this formula:

_CurrentSelection = 
VAR _Country = "Country"

VAR _Product = "Product"

VAR _Region = BLANK()

VAR _Clinic = "Clinic"

VAR _SP = BLANK()

VAR _Gender = "Gender"

VAR _Age = BLANK()


VAR _Result = 
IF( 
    ISBLANK( _Country ) && ISBLANK( _Product ) && ISBLANK( _Region ) && ISBLANK( _Clinic ) && ISBLANK( _SP ) && ISBLANK( _Gender ) && ISBLANK( _Age ),
    "No Filters Applied",
    CONCATENATEX(
    {
        IF(NOT(ISBLANK(_Country)), _Country, BLANK()),
        IF(NOT(ISBLANK(_Product)) && NOT(ISBLANK(_Country)), " | " & _Product, IF(NOT(ISBLANK(_Product)), _Product, BLANK())),
        IF(NOT(ISBLANK(_Region)) && (NOT(ISBLANK(_Country)) || NOT(ISBLANK(_Product))), " | " & _Region, IF(NOT(ISBLANK(_Region)), _Region, BLANK())),
        IF(NOT(ISBLANK(_Clinic)) && (NOT(ISBLANK(_Country)) || NOT(ISBLANK(_Product)) || NOT(ISBLANK(_Region))), " | " & _Clinic, IF(NOT(ISBLANK(_Clinic)), _Clinic, BLANK())),
        IF(NOT(ISBLANK(_SP)) && (NOT(ISBLANK(_Country)) || NOT(ISBLANK(_Product)) || NOT(ISBLANK(_Region)) || NOT(ISBLANK(_Clinic))), " | " & _SP, IF(NOT(ISBLANK(_SP)), _SP, BLANK())),
        IF(NOT(ISBLANK(_Gender)) && (NOT(ISBLANK(_Country)) || NOT(ISBLANK(_Product)) || NOT(ISBLANK(_Region)) || NOT(ISBLANK(_Clinic)) || NOT(ISBLANK(_SP))), " | " & _Gender, IF(NOT(ISBLANK(_Gender)), _Gender, BLANK())),
        IF(NOT(ISBLANK(_Age)) && (NOT(ISBLANK(_Country)) || NOT(ISBLANK(_Product)) || NOT(ISBLANK(_Region)) || NOT(ISBLANK(_Clinic)) || NOT(ISBLANK(_SP)) || NOT(ISBLANK(_Gender))), " | " & _Age, IF(NOT(ISBLANK(_Age)), _Age, BLANK()))
    },
    [Value],
    ""
)
)
RETURN
_Result


I did some tests and It's working properly.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Hi @Anonymous ,

 

I tested the solution provided by mark and it should meet your needs. If so, please mark it as the correct solution, and point out if the problem persists.

 

Best Regards,
Adamk Kong

Anonymous
Not applicable

Hi AAndrade,

 

Thanks for your response. Without any selection the pipe line delimiter has been hided. But when i select the country filter, the pipe line delimiter should not be displayed. If i select product, at that time that pipe line should be displayed.

nanbandinesh19_0-1709981868778.png


If i select product filter only the pipe delimiter should not be displayed.

nanbandinesh19_0-1709982361287.png

 

And one more if i select the dates between the range should be displayed From date and To date. Same pipe line scenario.

nanbandinesh19_1-1709982465290.png

We have lot of filter, how to displayed the full values in the object.

 

 

_AAndrade
Super User
Super User

Hi,

 

On the Return change your formula to this:

IF ( ISBLANK( _Product) && ISBLANK( _Country), BLANK(), _Country & " | " & _Product)





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Anonymous
Not applicable

Hi,

 

This is my current selection dax. Need to be hided the pipe line with one selection, if multiple selection it should be displayed.

 

nanbandinesh19_0-1709987048740.png

nanbandinesh19_1-1709987116301.pngnanbandinesh19_2-1709987165684.png

 

_Current Selection =

VAR _Country = IF( ISFILTERED( CLINIC[country] ),
                    "COUNTRY - " & CONCATENATEX(DISTINCT( CLINIC[country] ),
                                    CLINIC[country],", ", CLINIC[country], ASC ) )

VAR _Product = IF( ISFILTERED( CAREPLAN[Product] ),
                    "PRODUCT - " & CONCATENATEX(DISTINCT( CAREPLAN[Product] ),
                                    CAREPLAN[Product],", ", CAREPLAN[Product], ASC ) )

VAR _Region = IF( ISFILTERED( CLINIC[_F_Region] ),
                    "REGION - " & CONCATENATEX(DISTINCT( CLINIC[_F_Region] ),
                                    CLINIC[_F_Region],", ", CLINIC[_F_Region], ASC ) )

VAR _Clinic = IF( ISFILTERED( CLINIC[_F_Clinic] ),
                    "CLINIC - " & CONCATENATEX(DISTINCT( CLINIC[_F_Clinic] ),
                                    CLINIC[_F_Clinic],", ", CLINIC[_F_Clinic], ASC ) )

VAR _SP = IF( ISFILTERED( 'Date Table'[Date] ),
                    "SELECTED PERIOD - " & CONCATENATEX(DISTINCT( 'Date Table'[Date] ),
                                    'Date Table'[Date],", ", 'Date Table'[Date], ASC ) )

VAR _Gender = IF( ISFILTERED( PATIENT[gender] ),
                    "GENDER - " & CONCATENATEX(DISTINCT( PATIENT[gender] ),
                                    PATIENT[gender],", ", PATIENT[gender], ASC ) )

VAR _Age = IF( ISFILTERED( PATIENT[Age (groups)] ),
                    "AGE GROUP - " & CONCATENATEX(DISTINCT( PATIENT[Age (groups)] ),
                                    PATIENT[Age (groups)],", ", PATIENT[Age (groups)], ASC ) )

RETURN

IF( ISBLANK( _Country ) && ISBLANK( _Product ) && ISBLANK( _Region ) && ISBLANK( _Clinic ) && ISBLANK( _SP ) && ISBLANK( _Gender ) && ISBLANK( _Age ),
        "No Filters Applied",  _Country & " | "  & _Product & " | "  & _Region & " | "  & _Clinic & " | "  & _SP & " | "  & _Gender & " | "  & _Age  )  

Try this:

ISBLANK( _Country ) && ISBLANK( _Product ) && ISBLANK( _Region ) && ISBLANK( _Clinic ) && ISBLANK( _SP ) && ISBLANK( _Gender ) && ISBLANK( _Age ), "No Filters Applied",
IF(ISBLANK (_Country),,_Country & " | ") &
IF(ISBLANK( _Product),,_Product & " | " )&
...(Do the same for others filters)
 
For dates you can use the Min and Max function to define the initial and end dates.
After date out that option on the if condition.
 




Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Anonymous
Not applicable

It is not working...

Hi,

Please try this formula:

_CurrentSelection = 
VAR _Country = "Country"

VAR _Product = "Product"

VAR _Region = BLANK()

VAR _Clinic = "Clinic"

VAR _SP = BLANK()

VAR _Gender = "Gender"

VAR _Age = BLANK()


VAR _Result = 
IF( 
    ISBLANK( _Country ) && ISBLANK( _Product ) && ISBLANK( _Region ) && ISBLANK( _Clinic ) && ISBLANK( _SP ) && ISBLANK( _Gender ) && ISBLANK( _Age ),
    "No Filters Applied",
    CONCATENATEX(
    {
        IF(NOT(ISBLANK(_Country)), _Country, BLANK()),
        IF(NOT(ISBLANK(_Product)) && NOT(ISBLANK(_Country)), " | " & _Product, IF(NOT(ISBLANK(_Product)), _Product, BLANK())),
        IF(NOT(ISBLANK(_Region)) && (NOT(ISBLANK(_Country)) || NOT(ISBLANK(_Product))), " | " & _Region, IF(NOT(ISBLANK(_Region)), _Region, BLANK())),
        IF(NOT(ISBLANK(_Clinic)) && (NOT(ISBLANK(_Country)) || NOT(ISBLANK(_Product)) || NOT(ISBLANK(_Region))), " | " & _Clinic, IF(NOT(ISBLANK(_Clinic)), _Clinic, BLANK())),
        IF(NOT(ISBLANK(_SP)) && (NOT(ISBLANK(_Country)) || NOT(ISBLANK(_Product)) || NOT(ISBLANK(_Region)) || NOT(ISBLANK(_Clinic))), " | " & _SP, IF(NOT(ISBLANK(_SP)), _SP, BLANK())),
        IF(NOT(ISBLANK(_Gender)) && (NOT(ISBLANK(_Country)) || NOT(ISBLANK(_Product)) || NOT(ISBLANK(_Region)) || NOT(ISBLANK(_Clinic)) || NOT(ISBLANK(_SP))), " | " & _Gender, IF(NOT(ISBLANK(_Gender)), _Gender, BLANK())),
        IF(NOT(ISBLANK(_Age)) && (NOT(ISBLANK(_Country)) || NOT(ISBLANK(_Product)) || NOT(ISBLANK(_Region)) || NOT(ISBLANK(_Clinic)) || NOT(ISBLANK(_SP)) || NOT(ISBLANK(_Gender))), " | " & _Age, IF(NOT(ISBLANK(_Age)), _Age, BLANK()))
    },
    [Value],
    ""
)
)
RETURN
_Result


I did some tests and It's working properly.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Anonymous
Not applicable

Hi AAndrade,

 

This is working perfect..... Thanks for your support....

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Kudoed Authors