Forum Discussion
WSeirafi
Helper I
2 years agoIF statement performance
Hello, I'm witnessing a performance issue for a quite simple measure used in a big table. If I use this measure, the result is instant Measure = VAR CurrentVal = SELECTEDVALUE ( Table[Column...
Greg_Deckler
Community Champion
2 years agoWSeirafi ISBLANK is notorious for bad performance. Try this:
Measure =
IF (
SELECTEDVALUE ( Table[Column] ) = BLANK(),
1,
0
)
or
Measure =
IF (
SELECTEDVALUE ( Table[Column] ) <> BLANK(),
0,
1
)
or
Measure =
SWITCH( SELECTEDVALUE ( Table[Column] ),
BLANK(), 1,
0
)
WSeirafi
Helper I
2 years agoI tried with both suggestions you gave
Measure =
VAR CurrentVal = SELECTEDVALUE ( Table[Column] )
RETURN
SWITCH(CurrentVal,
BLANK(),1,
0
)
Didn't change anything. There is no other way to do this ?
Didn't change anything. There is no other way to do this ?
I would have added a calculated column, but this is supposed to be reacting to a slicer
- Greg_Deckler2 years ago
Community Champion
WSeirafi It's hard to say with the information provided. Would need additional context of the problem you are actually trying to solve. Is this something that could be done using the Filter pane?
- WSeirafi2 years ago
Helper I
Might be a solution
- WSeirafi1 year ago
Helper I
Hello,
I ended up merging all my data into one big table for this purpose, but my issue now is that when I use a Switch / if measure in my table, the slicer do not have any effect on it.
I guess it's the fact that the IF measure returns a value for every rown but how can I prevent this from happening ?
Thanks for your help