Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

if statement syntax error

Hello,   I am a bit new to this platfrom, and I am trying to write the below formula, but I am getting a Token RightParen expected error, and I am not sure why is the issue. It is highligting the "...
  • v-cherch-msft's avatar
    7 years ago

    Hi Anonymous 

    In query editor,you may create a custom column with M language:Text.Start and Text.End like below.

    =(if Text.Start([Season],1)="F" then "FH" else "SS")&Text.End([Season],2)

    Second way in DAX with IF function.New a column in data view.

    Column = IF(LEFT(Table5[Season],1)="F","FH","SS")&RIGHT(Table5[Season],2)

    Regards,