Forum Discussion
Help with converting IFS into a Custom Column
- 2 years ago
dukeof3arl ?? You can use SWITCH in a custom column.
Column = SWITCH( TRUE(), <logical condition 1>, <result if true>, <logical condition 2>, <result if true>, <logical condition 3>, <result if true>, ... (as many conditions/result pairs as you want) <result if no conditions are true> )
Greg_Deckler - can you give me a pointer on the first part? I'm unfamiliar with SWITCH or even how it would be used in this context.
dukeof3arl Sure:
SWITCH( TRUE(),
<logical condition 1>, <result if true>,
<logical condition 2>, <result if true>,
<logical condition 3>, <result if true>,
... (as many conditions/result pairs as you want)
<result if no conditions are true>
)
- dukeof3arl2 years agoNew Member
Greg_Deckler - Apologies - I'm doing this in PBI Desktop. Did I post this in the wrong forum category? Custom Column language doesn't recognize Switch.
- Greg_Deckler2 years agoCommunity Champion
dukeof3arl ?? You can use SWITCH in a custom column.
Column = SWITCH( TRUE(), <logical condition 1>, <result if true>, <logical condition 2>, <result if true>, <logical condition 3>, <result if true>, ... (as many conditions/result pairs as you want) <result if no conditions are true> )- dukeof3arl2 years agoNew Member
Greg_Deckler - I just did it in measures. But the result WAS using the switch function. I trimmed the excel formula down a bit.
Attainment = SWITCH(TRUE(),[Targ] < 0,([Actual] - [Targ])*-1 / [Targ] +1,[Targ] = 0,1,"null")