Forum Discussion

Bizo's avatar
Bizo
Frequent Visitor
3 years ago
Solved

DAX IF Statement Error

Hi All,   Ihave this DAX statement below but I'm running into the below error:   "DAX comparison operations do not support comparing values of type True/False with values of type Integer. Conside...
  • Greg_Deckler's avatar
    3 years ago

    Bizo First, use a SWITCH(TRUE(),...) statement, much cleander and you have to write your true/false conditions like:

    DueIn = 
      SWITCH(TRUE(),
        [Days Due] < -44000, "No Due Date",
        [Days Due] > -44000 && [Days Due] < 0, "Overdue",
        [Days Due] > 0 && [Days Due] <= 30, "0 - 30 Days",
        [Days Due] > 30 && [Days Due] <= 60, "31 - 60 Days",
        [Days Due] > 60 && [Days Due] <= 90, "61 - 90 Days", 
        "90+ Days"
      )