Ravindra BagaleCourses & study guides

10. Parameters in Power Query (and Other Kinds of Parameters)

10.3 Parameterising a File or Folder Path

Steps in Power BI

  1. Create FolderPath (Text) with current value C:\QuickCommerce\Blinkit\.
  2. Select the Source step of the query built from a Folder (or Excel/CSV) and click the ⚙ gear icon next to it.
  3. In the Folder path box, click the ABC drop-down › Parameter › choose FolderPath › OK. Many connector dialogs support this directly.
  4. For a single file, concatenate in M: File.Contents(FolderPath & "Products.xlsx").
Source   = Folder.Files(FolderPath),
Products = Excel.Workbook(File.Contents(FolderPath & "Products.xlsx"), null, true)

Ravindra Bagale's Tip

Mitrano, khup students parameterise the folder path but leave a trailing backslash in one value and not the other, so the combined path breaks. Decide on one convention (always end with "\") and test with both your development path and the shared path. Ghabru naka, don-teen vela kela ki savay hote.