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

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.

Reply
CJS1199
Frequent Visitor

Pasting code back into Power Query, double quotation marks not pasting properly

So I was creating a new custom column, based on one I created in another source, and I took the original code into Word for easy finding/replacing of certain pieces to create the new one. When pasting it back into the prompt in Power BI, I noticed the pieces I replaced with quotation marks were pasted as what seems to be specific opening and closing quotation marks, different from the ones used in the formula editor. This is causing an 'invalid identifier' error to occur.

 

I tried copying one of the 'correct' quotation marks and using the find/replace to swap out the 'incorrect' ones but no luck. My curiousity is wondering if there's a reason for this but ultimately, is there a workaround for this? I couldn't find anything about this online...

1 ACCEPTED SOLUTION

If you want to write your code with another program, use notepad or Visual Studio Code with M Language installed (intelliSense included!):

 

dufoq3_0-1727465843603.png


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Hi @CJS1199 ,

Thank you to all of you for your participation!
@CJS1199 , If you have already solved your problem, please accept the answers you found helpful as solutions so that more users facing the same problem can find a solution faster.

Best Regards,
Dino Tao

Omid_Motamedise
Super User
Super User

The same thing happen for me in another case, in such situation when I write quotation  it is different than normal one, so I press Ctrl+Z just after that and it is channged into the normal one, i think it is because of some setting in the word, specially for me which some time use language other than english


If my answer helped solve your issue, please consider marking it as the accepted solution.
dufoq3
Super User
Super User

Hi @CJS1199, it happens when you paste whole code into formula bar (I guess that you've copied whole query). You have to paste your code into Advanced editor.


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

So because I made the changes in Word, when I paste the code into there I still run into the same issue. Here's what I'm seeing in the Advanced Editor. I can manually replace them, but we're talking tens of thousands at least haha. I should have provided a screenshot in the original post, sorry about that. 

 

CJS1199_1-1727465556900.png

If you want to write your code with another program, use notepad or Visual Studio Code with M Language installed (intelliSense included!):

 

dufoq3_0-1727465843603.png


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Thank you again everyone for your help! Sorry for closing this out late, but what I wound up doing to get around this is downloading Visual Studio Code as @dufoq3 mentioned then, maybe because it had the familiar color coding, had a much easier time finding and replacing the 'incorrect' quotations with the ones necessary for the Advanced Editor/DAX. I'll definitely be using that program in the future!

Definitely downloading now for future use. Thank you!

You're welcome. Enjoy 😉


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors