Forum Discussion
Tinus1905
2 years agoResolver I
Filter slicer with IF function
Hello, I want to use my slicer and when I select the value "Cars" then the output in my card has to be "Cars measure", when I select the value "Music" then the output in my card has to be "Music...
danextian
2 years agoSuper User
Hi Tinus1905 ,
You don't use filter in this case. Filter returns a table and cannot be used in a measure without being aggregated.
The old school to achieve your end result as by creating a disconnected table containing the measure you want which can be created using the Enter Data feature or DAX then use a IF or SWITCH to return the measure you want. Example
Switching Measure =
SWITCH (
SELECTEDVALUE ( 'disconnected table'[measure name] ),
"Cars", [Cars Measure],
"Music", [Music Measure],
"Something", [Something Measure]
)
A faster and more efficient way to do is with the use of Field Parameters.
Tinus1905
2 years agoResolver I
Ah this works. But how do I use "NOT" in a value. For example: in the disconnected table [measure name] the list is longer with more names.
"Cars", [Cars Measure],
"Music", [Music Measure],
"<>Cars", [Something Measure]
"<>Music", [Something Measure]The function <> isnt working.