Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have the following code in a custom column, and it simply refuses to accept any variant of the very first then string value I want to add. Doesnt matter what I do, I get the same error. this seems like basic functionality, but i cannot get it to work at all. (I Can get it to work on the table view, but I really want this within the query.
Any help will be greatly appreciated as I need this custom column for use elsewhere in the power bi report
Solved! Go to Solution.
@hyperbob0811 - You don't use the paren's with if statements in M code. That's DAX syntax.
Should be:
if [alpha_code] = ...
@hyperbob0811 - You don't use the paren's with if statements in M code. That's DAX syntax.
Should be:
if [alpha_code] = ...
Thanks, now I get a token else error - how do I end this formula?
@hyperbob0811 - Add else "" or something like that.
excellent thanks - I was in full DAX and excel mode with the parenthesis and comma's - this seems like you basically right it out as you would say it!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |