Ohio Computer Academy - IT Training & Vocational Education in Dublin, OH
Ohio Computer Academy - IT Training & Vocational Education in Dublin, OH
All Courses
  • Free Training Courses
  • AI for Your Role
  • AI & Machine Learning
  • Cloud Tech
  • Data Science
  • DevOps
  • Dashboarding/BI
  • Database
  • WebDevelopment
  • Programming & Coding
  • MS Office & Workplace Productivity
  • QA & Test Automation
  • Professional & Career Development
  • Cyber Security

Courses

  • Computer Fundamentals for Beginners
  • MS Word for Beginners
  • Microsoft Excel for Beginners
  • Microsoft Azure for Beginners
  • AWS Cloud for Beginners
  • Oracle SQL Fundamentals
  • Tableau Fundamentals
  • Power BI Fundamentals
Explore All Programs

Courses

  • AI Essentials
  • AI for Administrative Professionals New Launch
  • AI for Managers & Team Leads
  • AI for Data Analytics & Power BI
  • AI for Software Developers
  • AI for Database & SQL Professionals
  • AI for Project Managers
  • AI for Marketing Professionals
  • AI for Sales Professionals
  • AI for HR Professionals
  • AI for Finance Professionals
  • AI for Customer Support Professionals
  • AI for QA & Test Engineers
  • AI for IT Support & System Admins
  • AI for Cybersecurity Analysts
  • AI for Job Seekers
Explore All Programs

Courses

  • Learn Claude Basics New Launch
  • Learn Claude Advanced New Launch
  • Applied Artificial Intelligence (AI) New Launch
  • AI for Workplace Productivity
  • Azure Fundamentals with AI
  • Advanced Microsoft Azure with AI
  • AI Implications for Business Strategy
  • Mastering ChatGPT & Generative AI Tools
  • Prompt Engineering
  • Agentic AI Solutions
  • AI Product Management
  • AI for Quality Control
Explore All Programs

Courses

  • AZ-900 Azure Fundamentals
  • DP-900 Azure Data Fundamentals
  • DP-100 Data Science on Azure
  • AWS Essentials
  • AWS Cloud Practitioner
  • AWS Solutions Architect
Explore All Programs

Courses

  • DP-100 Data Science on Azure
Explore All Programs

Courses

  • DevOps Essentials
  • DevOps with AWS
  • DevOps with Azure
Explore All Programs

Courses

  • Business Analytics: From Data to Insights New Launch
  • Power BI Advanced
  • Data Analytics with Excel
  • Tableau Beginner
  • Tableau Data Consumer
  • Alteryx & Tableau
  • Tableau Advanced
  • Tableau Certification prep
  • Power BI Beginner
  • Cognos Analytics
Explore All Programs

Courses

  • SQL Server for Beginners
  • SQL for Analysts
  • SQL Server Advanced
  • SQL Server T-SQL Programming
  • SSIS
  • Oracle SQL for Beginners
  • Oracle PL/SQL
  • Oracle SQL Advanced
  • Big Data with Hadoop: HDFS, MapReduce & Ecosystem Tools
  • MS Access
Explore All Programs

Courses

  • Angular Frontend Development
  • Spring 5 Framework
  • Full Stack Web Development
Explore All Programs

Courses

  • Learn Python
  • Python PCEP
  • Python PCAP
  • JavaScript & jQuery
  • Java Certification
  • Python for Data Science
  • Machine Learning with Python
Explore All Programs

Courses

  • Analyzing Data with Excel New Launch
  • Workplace Digital Skills
  • Excel Beginners to Advanced Trending Now
  • Excel for Finance
  • Excel for HR
  • Workplace Computer Skills
Explore All Programs

Courses

  • Selenium QA Automation (Java)
  • Selenium QA Automation (Python)
  • API Testing
  • QA Automation with Python (Advanced)
Explore All Programs

Courses

  • Scrum Master Certification
  • Lean Six Sigma Green Belt Certification
  • Business Analyst
Explore All Programs

Courses

  • Cyber Security Foundations for Beginners
  • Computer Networking for Cybersecurity
  • Windows & Linux Security Administration
  • Ethical Hacking & Penetration Testing
  • Artificial Intelligence (AI) in Cybersecurity
Explore All Programs
  • About Us
    • OCA Skill Sprint Method
    • Meet the Founder
  • Blogs
    • Career Building
    • AI / Machine Learning
    • MS Excel
    • Programming Essentials
    • Database
    • Cloud Computing
    • Tableau
    • Power BI
    • Web Development
    • Tips for Success
    • Qlik
    • Soft Skills
    • Technology
    • Business Intelligence Analyst
    • Message from the CEO
    • DATA ANALYST
  • TechCred
  • Find Your Training
  • Contact Us
Ohio Computer Academy - IT Training & Vocational Education in Dublin, OH
Ohio Computer Academy - IT Training & Vocational Education in Dublin, OH

 

  • info@ohiocomputeracademy.com
  • +1 866-648-7284
  • Home
  • About Us
  • Blogs
    • Career Building
    • AI / Machine Learning
    • MS Excel
    • Programming Essentials
    • Database
    • Cloud Computing
    • Tableau
    • Power BI
    • Web Development
    • Tips for Success
    • Qlik
    • Soft Skills
    • Technology
    • Business Intelligence Analyst
    • Message from the CEO
    • DATA ANALYST
  • TechCred
  • Find Your Training
  • Contact Us
Find With Us
  • Home
  • Blogs
  • Power BI
  • HOW TO CREATE DATA SOURCE PARAMETERS IN POWER BI

HOW TO CREATE DATA SOURCE PARAMETERS IN POWER BI

Parameters allow developers to create dynamic connection strings, enabling flexibility in connecting to different data sources or environments. In this blog, we will see how to use data source parameters in Power BI. It also includes a step-by-step exercise for practice.

New to Power BI? Get hands-on, step-by-step guidance in our Power BI for Beginners course. Start learning now.

BENEFITS OF USING DATA PARAMETERS IN POWER BI

Data source parameters provide the following advantages:

  1. Creation of dynamic connection strings, enabling flexibility in connecting to different data sources or environments.

  2. Parameters make it easier to manage and maintain Power BI reports. Developers can centralize connection details, making updates more efficient.

  3. Reports become reusable across different environments, such as, Dev, QA and Prod.


STEPS TO CREATE DATA SOURCE PARAMETERS IN POWER BI

The steps to create and utilize data source parameters in Power BI are:

  1. Load the required data.

  2. Navigate to Query editor and create a new parameter by navigating to Hometab and then Manage Parameters.

  3. In the Manage Parameters box, provide the name of the parameter, Type, Suggested Values and Current Value.

  4. Replace the hard-coded path in the Advance Editor code with the parameter name.

  5. Select the parameter and the data source connection will change based on the selected parameter value.


EXERCISE: CREATE A DATA SOURCE PARAMETER TO CONNECT TO DIFFERENT EXCEL FILES.

In the example below, we will create three folders and XLS files within each of these folders. We will connect to these files in Power BI based on parameter selection. 

To illustrate this concept, I have created three folders in my C:\ drive: Dev, QA, and Prod. Each of these folders contains an Excel file named CustomerData.xls. 

It has only two columns: CustomerName and Sales. The data differs in the three files.

The structure of the XLS in Dev, QA, and Prod folders is shown below:

The structure of the file is same, but the data varies.

Now, follow the steps below:

  1. Launch Power BI desktop and load the CustomerData.XLS from the Dev folder. Learn how to connect Excel datasource in Power BI.

  2. Select Transform Data to navigate to the Query Editor. The data preview will display CustomerName as Dev as we are connected to the XLS in the Dev folder.

  3. From the menu, click on the Advanced Editor; it will display the text as follows:

let
Source = Excel.Workbook(File.Contents("C:\PowerBI_Blogs\Dev\CustomerData.xlsx"), null, true),
Data_Sheet = Source{[Item="Data",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Data_Sheet, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"CustomerName", type text}, {"Sales", Int64.Type}})
in
#"Changed Type"

It displays the current file path as C:\PowerBI_Blogs\Dev\CustomerData.xlsx, which is the location where I have saved my XLS file.

Our objective is to replace this path with the parameter.

  1. Create a parameter.

From the Home tab, select Manage Parameters and then select New Parameter.

Provide the following inputs in the Manage Parameters box.

  • Name. Provide a name of the parameter.

  • Type. This is the type of the parameter. In this case it will be Text.

  • Suggested Values. It should be list of values, as we will be providing the values as Dev, QA, and Prod.

  • Default Value. Select the default value from the drop-down which you wish to provide to the parameter.

  • Current Value. Select the value from the dropdown.

Manage Parameters settings.

  1. Change the Advance Editor code.

Click on the Advanced Editor and change the hard-coded path with the parameter as shown below:

C:\PowerBI_Blogs\”& SourceParam &”\CustomerData.xlsx”)

the ampersand (&) symbols is used for the concatenation. 

The new Advanced Editor code (with the parameter) will look like the following:

let
Source = Excel.Workbook(File.Contents("C:\PowerBI_Blogs\"& SourceParam &"\CustomerData.xlsx"), null, true),
Data_Sheet = Source{[Item="Data",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Data_Sheet, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"CustomerName", type text}, {"Sales", Int64.Type}})
in
#"Changed Type"
  1. Now, changing the parameter value will display the data from the respective folder.

Selecting QA from the parameter, displays the file from the QA folder.

Like
Chandraish Sinha

Chandraish Sinha is the Founder and President of Ohio Computer Academy, a leading institution committed to delivering high-quality IT education. With a passion for teaching and a belief in his company’s mission—Inspire, Educate & Evolve—Chandraish brings over 25 years of experience in the Information Technology industry.

Explore more of his work on his Amazon Author Profile.

0 Comments

Add Your Comment

Post a Comment

Required fields are marked *

✅ Thanks for adding your comment! It will appear after moderation.

0 Comments

Related Blogs
View All Blogs
Power BI Components
Read More
Connect to Excel Data Source in Power BI
Read More
Creating Scatter Chart in Power BI
Read More
Ohio Computer Academy - IT Training & Vocational Education in Dublin, OH
Ohio Computer Academy - IT Training & Vocational Education in Dublin, OH

Registered with the Ohio State Board of Career Colleges and Schools — School Registration No. 2395

About Us
  • Contact Us
  • Our Story
  • Training Gallery
  • Reviews
  • Books
  • Greater Columbus Training Center
Trainings/Services
  • Course Categories
  • Learning Paths
  • Frequently Asked Questions
  • AI Advantage
Contact Us
  • Phone:+1 866-648-7284
  • E-mail: info@ohiocomputeracademy.com
  • Address:

    Dublin, Ohio
    5900 Sawmill Road, Suite # 150, Dublin, OHIO 43017 USA

Thank you
Failed
Free Training Courses
  • Computer Fundamentals for Beginners
  • MS Word for Beginners
  • Microsoft Excel for Beginners
AI Courses
  • Claude Basics
  • Claude Advanced
  • AI for Workplace Productivity
  • Prompt Engineering
  • Agentic AI Solutions
  • AI for Quality Control
Cloud Tech
  • DP-900 Azure Data Fundamentals
  • DP-100 Data Science on Azure
  • AWS Technical Essentials
  • AWS Cloud Practitioner
  • AWS Solutions Architect
DevOps
  • DevOps Essentials
  • DevOps with AWS
  • DevOps with Azure
Dashboarding/BI
  • Tableau Beginner
  • Power BI Beginner
  • Data Analytics with Excel
Database
  • Oracle SQL for Beginners
  • SQL for Analysts
  • SQL Server for Beginners
MS Office & Workplace Productivity
  • Workplace Digital Skills
  • Excel for Finance
  • Excel for HR
  • Excel Beginners to Advanced
  • Workplace Computer Skills
Learning Hub
  • Begin Your IT Career
  • Generative AI & Workplace Productivity Foundations
  • Claude AI Learning Path
  • Data Visualization Foundations
  • Data Analytics Career Path
  • AI for Business & Data Applications
  • Programming Foundations & Development Path

© 2026 Ohio Computer Academy. All rights reserved.

  • Privacy
  • Terms & Conditions