Forum Discussion
drrai66
8 years agoResolver I
Calculated Column with multiple IF Else Then
Hi All, I have two calculated Columns which I created in the Data view from other Columns. The Calculated Columns are [Number of Days] and [Action] Number of Days Action Result 4 2 Gre...
- 8 years ago
The DAX is like
Column = SWITCH ( TRUE (), yourTable[Number of Days] < 5 && yourTable[Action] <= 2, "Green", yourTable[Number of Days] < 8 && yourTable[Action] <= 2, "Yellow", yourTable[Number of Days] >= 8 && yourTable[Action] <= 2, "Red", yourTable[Number of Days] <= 15 && yourTable[Action] <= 3, "blue", yourTable[Number of Days] >= 15 && yourTable[Action] > 3, "Orange", "Violet" )
Eric_Zhang
8 years agoMicrosoft Employee
The DAX is like
Column =
SWITCH (
TRUE (),
yourTable[Number of Days] < 5
&& yourTable[Action] <= 2, "Green",
yourTable[Number of Days] < 8
&& yourTable[Action] <= 2, "Yellow",
yourTable[Number of Days] >= 8
&& yourTable[Action] <= 2, "Red",
yourTable[Number of Days] <= 15
&& yourTable[Action] <= 3, "blue",
yourTable[Number of Days] >= 15
&& yourTable[Action] > 3, "Orange",
"Violet"
)
drrai66
8 years agoResolver I
Thanks and Many Many Thanks. Learnt something new from you and Solved my Problem. I used your Formula at Many many places in my dataset and it works like Charm!!!
Thanks
Deepak
- Eric_Zhang8 years agoMicrosoft Employee
Glad to help. :)