Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

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"

 

1 ACCEPTED SOLUTION
Pragati11
Super User
Super User

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

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

3 REPLIES 3
Pragati11
Super User
Super User

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

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Many Thanks

AlB
Super User
Super User

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

 

SU18_powerbi_badge

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.

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.