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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
justin22pogi
Regular Visitor

If Function in PowerBI Query Editor

Hi All,

 

I want to add a column in my existing table in Power BI Query Editor using add custom column. The formula that I want to use is that:

 

If column A = "#" then value in column B else column A.

 

I cannot construct the formula since I am receiving a Token Literal expected. Thanks in advance!

1 ACCEPTED SOLUTION
Barnee
Advocate IV
Advocate IV

Hi,

you may want to check if you wrote the "if" function in the rigth syntax since a little mistype could possibly couse error.
I didn't get an error with the following formula following yours.

 

if [column a] = "#" then [column a] else [column b]

 

 

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi  @justin22pogi,

 

Have you solved your problem with the reply provided by @Barnee?

 

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please share some screenshots to specify your problem.

 

For further, you could have a view of the syntax of IF FUNCTION in Power Query.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Barnee
Advocate IV
Advocate IV

Hi,

you may want to check if you wrote the "if" function in the rigth syntax since a little mistype could possibly couse error.
I didn't get an error with the following formula following yours.

 

if [column a] = "#" then [column a] else [column b]

 

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.