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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Dmitry_Chukov
Frequent Visitor

We cannot convert a value of type List to type Text.

I have to tables (1-Data, 2-Path). Table "Path" with only one row with path to folder. I try to paste path to folder from table "Path" for table "Data"

 

let
    Source = Folder.Files(Path[Path to folder]).

 

Expression.Error: We cannot convert a value of type List to type Text..
    Value=List
    Type=Type

 

 

 

1 ACCEPTED SOLUTION

You mean you get an error message. Why don't you mention that it is an error message?

 

Anyhow, you can prevent that error by adjusting the Privacy Level setting in File - Options and Settings - Options:

 

Ignore Privacy Levels.png

Specializing in Power Query Formula Language (M)

View solution in original post

6 REPLIES 6
MarcelBeug
Community Champion
Community Champion

The single argument for Folder.Files is path, so it is unclear what you try to concatenate.

 

Example: this is the path to my DateTimeTables folder:

 

= Folder.Files("C:\Users\Marcel\OneDrive - Bemint\Office 365\Power Query\DateTimeTables")

 

Can you explain what you try to achieve?

Specializing in Power Query Formula Language (M)

If i write with mistakes, Im sorry for my english.

 

I have a file "Data.xlsx", which updates every month and folder name changes every month  too

Path to file ("Data march.xlsx")

1. C:\Work\3. March\Data march.xlsx

2. C:\Work\4. April\Data april.xlsx   and so on

 

In Power BI i make a inquiry to excel files from folder C:\Work\3. March\  than make excel file (Path to folder) with only one table with one row, which automatically get path to file (C:\Work\3. March\, C:\Work\4. April\ and so on).  

 

I would like to automatically update the path to folder in inquiry for file "Data.xlsx" , so the path for source Source =Folder.Files ("C:\Work\3. March")  is now, i try get the path from inquiry/table "Path to folder".     Table "Path to folder" have column with name "Path" and one row with the path to folder ("C:\Work\4. April\")

 

Then you can use:

 

let
    Source = Folder.Files(#"Path to folder"[Path]{0})
in
    Source
Specializing in Power Query Formula Language (M)

I try it.

 

The inquiry "Data" (a step "Source") refers to other inquiries or stages and can't address data source directly. Change this combination of data.

You mean you get an error message. Why don't you mention that it is an error message?

 

Anyhow, you can prevent that error by adjusting the Privacy Level setting in File - Options and Settings - Options:

 

Ignore Privacy Levels.png

Specializing in Power Query Formula Language (M)

I am sorry, that i don't write it was a mistake.

 

I change Privacy Levels. Now it works.  Thank you very much.  

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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