Ravindra BagaleCourses & study guides मराठी Track your progress

6. Power Query Essentials

6.8 Parameters (Overview)

Start with a problem

Ravindra's Source step contains C:\Users\Ravindra\Desktop\pq_raw_pune_export.csv. On Shraddha's laptop the query fails.

Explain simply

A parameter is a named value (folder path, server, date) used inside queries. Change it in one place. Module 10 covers parameters fully.

Show the data

Parameter Type Current value
FolderPath Text C:\PBI\practice\

About this data: This table uses columns: Parameter, Type, Current value. This table uses columns: Laptop, FolderPath, Orders rows. This table uses columns: Wrong result, Reason, Correction. Values shown are the lesson examples already on this page (not a new dataset).

Fictional sample data. Practice file: pq_raw_pune_export.csv (source: src/practice/).

Demonstrate

  1. Home › Manage Parameters › New Parameter: Name FolderPath, Type Text, Current value C:\PBI\practice\ › OK.
  2. Open the Source step of Raw_Pune in the formula bar; replace the hard-coded folder with FolderPath & "pq_raw_pune_export.csv".

    Your result should look like this:

    Formula bar (start)
    = Csv.Document(File.Contents(FolderPath & "pq_raw_pune_export.csv"), …
  3. Change FolderPath to Shraddha's folder and refresh.

Show the result

Your result should look like this (fictional sample):

Laptop FolderPath Orders rows
Ravindra C:\PBI\practice\ 4
Shraddha D:\Class\practice\ 4

Explain what happened

Only the parameter value changes; every query using it follows.

Explore further

  • Parameters also feed templates (.pbit) and incremental refresh (Module 10).

Detailed reference for this lesson:

A parameter is a named value, such as a folder path, a server name or a start date, that queries can use instead of hard-coded text. Create it with Home › Manage Parameters › New Parameter. Module 10 covers parameters fully: types, suggested values and lists, parameterised file and server paths, date-range filters, templates (.pbit), and the RangeStart/RangeEnd parameters used by incremental refresh (फक्त नवीन/बदललेला डेटा अद्ययावत करणे).

Ravindra Bagale's Tip

Friends, many students hard-code a folder path like C:\Users\Ravindra\Desktop\Data, and the report breaks on every other laptop and in the Service. Put paths, server names and date limits in parameters from the start (Module 10), so changing environments is a one-field edit. Don't worry – after doing it two or three times, it becomes a habit.

Fix common mistakes

Wrong result Reason Correction
File not found Missing trailing backslash End the folder value with \
Parameter ignored Source still hard-coded Edit the Source formula
Type error Parameter type Any Use Text

Practise independently

Practice task

Where would you change the path when moving to the Service with a SharePoint file?

Hints
  • Connector changes too.
Solution

Switch the source to the SharePoint/OneDrive connector (Module 3.5); a parameter can hold the site URL.

Think like a professional

No hard-coded paths is a common code-review rule.

Ravi Sir's Cards for this lesson

मराठी cards