Forum Discussion
Anonymous
2 years agoNot 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[coun...
- 2 years ago
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.
_AAndrade
2 years agoResident Rockstar
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.
Anonymous
2 years agoNot applicable
It is not working...
- _AAndrade2 years agoResident Rockstar
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.- Anonymous2 years agoNot applicable
Hi AAndrade,
This is working perfect..... Thanks for your support....