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
gerotutu
New Member

How to skip the processing of a file when datasource.notfound in Power Query?

Power Query takes from a cell the path it should go for the source files.

I want to handle the situation when there are no files in that folder or when there isn't any text in the cell referring to the path. The goal is to skip the following steps (or maybe to cheat the next steps with an empty table).

I tried, among many things, the functions try... otherwise without any success.

This is how my code starts:

let
DataAcesPath = Excel.CurrentWorkbook(){[Name="DataAcesPath"]}[Content][Column1]{0},
Origen = Folder.Files(DataAcesPath) ,
#"Archivos ocultos filtrados1" = Table.SelectRows(Origen, each [Attributes]?[Hidden]? <> true),

 

Could you please help me out with this? 


Many many thanks for your support,
Geronimo

3 REPLIES 3
gerotutu
New Member

Thanks @lbendlin

 

Would you teach me how to do it?

 

I've been trying several ways, but I cannot find the way to write in the code, "if the folder is empty, use this empty table"

 

Cheers

Folder.Files() produces a lot of columns. Which of these do you need in the next steps?

 

Read about #table()

lbendlin
Super User
Super User

(or maybe to cheat the next steps with an empty table)

Sounds like the most robust option.

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.

Top Solution Authors