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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
v-junyant-msft
Community Support
Community Support

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
Memorable Member
Memorable Member

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

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.