Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Create a measure with multiple If statments

I'm very new to DAX and would like to know how to create a certain measure. I would like to create a DAX measure to allow me to format the Status field result ‘Open’ according to the number of days t...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Anonymous  - The SWITCH function is ideal for multiple IFs. Example:

    CompletionStatus  = 
    SWITCH(
    TRUE(),
       Status = "Open" && Days to Completion <0,  -1,
       Status = "Open" && Days to Completion >=0 && Days to Completion < 7, 1,
       etc.
    )