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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Eric7
Resolver I
Resolver I

Copy / paste from Power Query in Power BI Desktop to Power Query in Power BI Service

Hi, when I copy a string containing line breaks from Power Query in Power BI Desktop to Power Query in Power BI Service, I get all line breaks replaced with (#CR) and/or (#LF). Why does this happen, is there a different line break encoding between desktop and service version of Power Query? Is there a work around? It si quite annoying, as we find doing coding in the desktop version to be much more efficient than in the service version of Power Query, so copying code from desktop to the service is the natural way to go.

 

Eirik

 

6 REPLIES 6
ibarrau
Super User
Super User

Hi. That's weird. I didn't have any issues in the past. You can copy the whole table to avoid issues there like the video of guy in a cube:

https://www.youtube.com/watch?v=YWp4FKzIBxM

Hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Hi, I should have added a screen shot of the issue to explain it better. This is what I get when I press Ok in Advanced Editor with a SELECT statment containing line breaks in Power Query in a dataflow in Power BI Service:

 

Eric7_0-1617108415659.png

It seems not to support regular linebreaks, but encodes them into #CR and #LF! So my question is: Is there any way to preserve normal line breaks in such a string in a dataflow in Power BI Service?

 

Anonymous
Not applicable

I had this same problem just now. Unsure if you managed to solve this but for myself, I've saved a dynamic date calendar table as code to paste into a Blank Query when starting a new project. This same error kept showing up until I added a "=" at the beginning of the code. 

This might sound crazy but I think I have seen this issue when you are writing the blank query, the whole script is not correct (it has a syntax error or something like that) and you click the Ok or accept button. Then the engine breaks the line break with the hidden code for that like (#cf).
Be sure to copy, paste and finish the blank query with the Let and the In completely before closing the advanced editor. If it fails, it breaks.

Hope that make sense. It's not the best approach I know 😞


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

This issue seems to alway happen, blank query, syntax error or not:

 

Eric7_0-1617132484170.png

 

It looks like a new expected behavior 😞

I'm sorry but I don't think you can get rid of that addition in dataflows. You can suggest an idea about this:
https://ideas.powerbi.com/

You can also try opening a ticket but I think they won't say that there is an error there.

Regards,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.