Forum Discussion
Show blank when nothing is selected
I am using the measure below, how can I adjust this measure so it only shows a value when sliced and shows nothing when it is not sliced?
Test = IF(ISFILTERED('Distinct Table'[Direct Report Full Name]),SELECTEDVALUE('Distinct Table'[Direct Report Full Name]),IF(ISFILTERED('Distinct Table'[Officer Full Name]),SELECTEDVALUE('Distinct Table'[Officer Full Name]),IF(ISFILTERED('Distinct Table'[VP/AVP Full Name]),SELECTEDVALUE('Distinct Table'[VP/AVP Full Name]))))
2 Replies
- vicky_Super User
If you want blank to be shown at the end if none of the other IF conditions are met, then just put BLANK() as the else argument in your last IF() statement:
Test = IF(ISFILTERED('Distinct Table'[Direct Report Full Name]),SELECTEDVALUE('Distinct Table'[Direct Report Full Name]),IF(ISFILTERED('Distinct Table'[Officer Full Name]),SELECTEDVALUE('Distinct Table'[Officer Full Name]),IF(ISFILTERED('Distinct Table'[VP/AVP Full Name]),SELECTEDVALUE('Distinct Table'[VP/AVP Full Name]), BLANK()))) - Manoj_NairSolution Supplier
dw700d- It's half baked query, so i'm guessing, please see if this works. Or you need to tweak the DAX.
Test = IF( HASONEVALUE('Distinct Table'[Direct Report Full Name]) && NOT(ISFILTERED('Distinct Table'[Officer Full Name])) && NOT(ISFILTERED('Distinct Table'[VP/AVP Full Name])), SELECTEDVALUE('Distinct Table'[Direct Report Full Name]), IF( HASONEVALUE('Distinct Table'[Officer Full Name]) && NOT(ISFILTERED('Distinct Table'[Direct Report Full Name])) && NOT(ISFILTERED('Distinct Table'[VP/AVP Full Name])), SELECTEDVALUE('Distinct Table'[Officer Full Name]), IF( HASONEVALUE('Distinct Table'[VP/AVP Full Name]) && NOT(ISFILTERED('Distinct Table'[Direct Report Full Name])) && NOT(ISFILTERED('Distinct Table'[Officer Full Name])), SELECTEDVALUE('Distinct Table'[VP/AVP Full Name]), BLANK() ) ) )HASONEVALUE() function checks if there is exactly one value in the specified column, and NOT(ISFILTERED()) ensures that no filters are applied on the other columns. The measure will return BLANK()
Let me know if this work, or else send a sample datasets to look your requirement in details. Thanks