Forum Discussion
Default value when no filter selected
- 5 years ago
Hi rschaudhr,
You should use a measure similar to the one below:
Comments selection = IF ( ISFILTERED ( CommentsTable[Department] ), SELECTEDVALUE ( CommentsTable[Comments] ), CALCULATE ( SELECTEDVALUE ( CommentsTable[Comments] ), FILTER ( ALL ( CommentsTable[Department], CommentsTable[Comments] ), CommentsTable[Department] = "Investments" ) ) )
Hi rschaudhr ,
What do you want when more than one is selected on the slicer? All of the values or just the first one?
If you want to concatenate all the values then you should use somethig similar to this one:
Comments selection =
IF (
ISFILTERED ( CommentsTable[Department] ),
CONCATENATEX(ALLSELECTED(CommentsTable[Comments],CommentsTable[Department]), CommentsTable[Comments], "/"),
CALCULATE (
SELECTEDVALUE ( CommentsTable[Comments] ),
FILTER (
ALL ( CommentsTable[Department], CommentsTable[Comments] ),
CommentsTable[Department] = "Investments"
)
)
)
Be aware that this gives you a text value with all the comments selected also if you have all the values selected on your slicer what works is the last syntax does not return only the Investment.
MFelix ,
So below are a few senario:
1) when no filter is selected in department slicer, only investment comment will show.
2) when HR filter is selected in department slicer, only HR comment will show.
3) when HR and IT filter is selected in department slicer, then HR and IT comments will show.
4) when HR, IT and Operation filter is selected in department slicer, then HR, IT and operation comments will show.
5) when All filter is selected in department slicer, then all comment will show.
I hope these senarios help.
Thank you!
- MFelix5 years agoSuper User
Correct for all of them.