Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Custom Column if formula

Hi Experts

 

how would you write the following If else formula for a custom column in Power Query

 

Currency = if [storeid] =1 then "GBP" elseif

[storeid] = 2, then "Eur" elseif

[storeid = 3 then "IRE" elseif

[storeid] = 4 then "USD"

 

  • Hi Anonymous ,

     

    You can write it something as follows:

    if [storeid] = 1 then "GBP"

    else if [storeid] = 2, then "Eur"

    else if [storeid = 3 then "IRE"

    else if [storeid] = 4 then "USD"

    else " "

     

    Thanks,

    Pragati

3 Replies

  • Hi Anonymous ,

     

    You can write it something as follows:

    if [storeid] = 1 then "GBP"

    else if [storeid] = 2, then "Eur"

    else if [storeid = 3 then "IRE"

    else if [storeid] = 4 then "USD"

    else " "

     

    Thanks,

    Pragati

    • Anonymous's avatar
      Anonymous
      Not applicable

      Many Thanks

  • AlB's avatar
    AlB
    Community Champion

    Hi Anonymous 
    You were very close:

    if [storeid] =1 then "GBP" else if
    [storeid] = 2  then "Eur" else if
    [storeid] = 3 then "IRE" else if
    [storeid] = 4 then "USD" else null

     

    Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.