Forum Discussion
OneData
3 years agoNew Member
Power BI version of 'Case When' using "Switch" Function
Hi guys - i'm new to dax and am having a bit oftrouble with what I would like to think should be something simple. Essentially i have paramaters for each bucket listed below and I want those to d...
- 3 years ago
Fixed it - looks like instead of filter - using contains worked just fine for me - hope this helps someone in the future!
ENLR Delta =SWITCH(TRUE(),CONTAINS('Application','Application'[Fico Range] = "640-679"),([Net Loss Ratio] - [640-679 Value]),CONTAINS('Application]','Application'[Fico Range] = "680-699"),([Net Loss Ratio] - [680-699 Value]),CONTAINS('Application','Application'[Fico Range] = "700-739"),([Net Loss Ratio] - [700-739 Value]),CONTAINS('Application','Application'[Fico Range] = "740-799"),([Net Loss Ratio] - [740-799 Value]),CONTAINS('Application','Application'[Fico Range] = "800+"),([Net Loss Ratio] - [800+ Value]),0)
FreemanZ
Super User
3 years agohi OneData
what contexts do you have for the measure? Or how are you going to present this measure?
- OneData3 years agoNew Member
Similarly to case when - it will be presented in a single column - however for each bucket i need each desired input. I was able to accomplish this in power query during etl on a another column in the dataset but this one here depends on numeric parameters so i have to figure out a measure to accomplish the "case when" scenario