Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I tried to trap like below, but not working. Run time error still produced. Any help would be appreciated. Thank you.
Source = Try Folder.Files("C:\nodirectory"),
output = if Source[HasError] then "Error" else "Good"
Solved! Go to Solution.
@bidev,
Please use the following code .
let
FolderPath = "C:\nodirectory",
Test = try List.Count(Folder.Files(FolderPath)[Content]),
Source = if Test[HasError] then "Cannot find Data Source" else Folder.Files(FolderPath)
in
Source
Regards,
Lydia
@bidev,
Please use the following code .
let
FolderPath = "C:\nodirectory",
Test = try List.Count(Folder.Files(FolderPath)[Content]),
Source = if Test[HasError] then "Cannot find Data Source" else Folder.Files(FolderPath)
in
Source
Regards,
Lydia
Lydia,
Thank you very much for the solution. It works perfectly!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |