Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

IF/OR Results

Hello everyone...
 
I'm trying to create a calculated column I can use as a slicer to filter projects that have a budget minus forecast variance of -5 or greater (i.e. -6, -7, -8 too) OR greater than 5. I'm using the expression below but it's returning rows with values in between. 
Does anything jump out as something that needs to be tweaked in the below expression?
  
Change Required = IF(OR('Table'[Budget] - 'Table'[Forecast] < -5,'Table'[Budget] - 'Table'[Forecast] > 5),"Yes","No")
 
Thanks in advance to anyone who can assist.
  • Hi Anonymous 

    the statement seems good. maybe just a little tuning like

    Change Required = 
    var _diff = 'Table'[Budget] - 'Table'[Forecast]
    RETURN
    IF(ABS(_diff) > 5),"Yes","No")

2 Replies

  • az38's avatar
    az38
    Community Champion

    Hi Anonymous 

    the statement seems good. maybe just a little tuning like

    Change Required = 
    var _diff = 'Table'[Budget] - 'Table'[Forecast]
    RETURN
    IF(ABS(_diff) > 5),"Yes","No")
    • Anonymous's avatar
      Anonymous
      Not applicable

      I like that much better and it's working. Thank you az38