Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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!
Solved! Go to Solution.
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]
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
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]
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |