Forum Discussion

bhmiller89's avatar
bhmiller89
Helper V
10 years ago
Solved

IF Statement - Power BI Desktop

I Have a column with values that are either 9 or 4.  I need to make all of the 9s show as 8s but leave the 4s as is.  I was playing with the "If[ScheduledDuration] = 9, "8",...." but don't know what to use for the "false" qualifer.

 

Any suggestions would be great.

  • It works great if I remove the "" from 8.  Thanks for your help!

4 Replies

  • Have you tried just using the result of the field?  Like the statement below...

     

    If[ScheduledDuration] = 9, "8", [ScheduledDuration])

    • bhmiller89's avatar
      bhmiller89
      Helper V

      I get the error "Expressions that yield variant data-type cannot be used to define calculated columns"

    • bhmiller89's avatar
      bhmiller89
      Helper V

      It works great if I remove the "" from 8.  Thanks for your help!