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

Join 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.

Reply
Matan
Frequent Visitor

Copy/Paste Query Code from PowerBI Desktop UI to Dataflow Error

Hi,

 

I'm following Miguel Escobar "Combine or Append Data: Optimal Combination Pattern" , Source files and blog in the link  - https://www.poweredsolutions.co/2019/04/30/combine-or-append-data-optimal-combination-pattern/

Everything works fine when using the code in the PowerBI Desktop, but when trying to copy/paste the code to new dataflow entity I'm getting error.

 

Code:

 

 

 

let
fnCSV_Read = (MyFile as binary) => 
Table.PromoteHeaders(Csv.Document(MyFile, [Delimiter=",", Columns=4, Encoding=1255, QuoteStyle=QuoteStyle.None]))
in
let
    Source = Folder.Files("C:\Users\Matan\Desktop\Sales"),
    #"Removed Other Columns" = Table.SelectColumns(Source,{"Content"}),
    Content = List.Transform(#"Removed Other Columns"[Content],Binary.Buffer),
    Custom1 = List.Transform(Content,fnCSV_Read),
    Custom2 = Table.Combine(Custom1)
in
    Custom2

 

 

 

 

Power BI Desktop Screenshot:

SharedScreenshot.jpgSharedScreenshot.jpg

 

Power BI Servic Screenshot:

SharedScreenshot.jpgSharedScreenshot.jpg

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @Matan ,

 

Your folder is on premises, you need to add it in your gateway.

And you could split your codes as two parts: query and invoke function.

 

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi @v-eachen-msft ,

 

My folder is already configured in the getway.

The problem is indeed with the code syntax which work well in the desktop version and fails to do so in the service unless I split the code. There is any vision to make it work in the near future?

 

Regards,

Matan Baruch

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.