Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
WB=workbook |
P=parameter |
Q=query |
Solved! Go to Solution.
I took it a step further and give you an example.
I created this little table in Excel
I created the following query in aanother workbook
let
// Connect to the parameter workbook.
Source = Excel.Workbook(File.Contents("C:\.....\How to create a parameter library to use in different workbooks with PQ.xlsx"), null, true),
// Access the ParameterTable
ParameterTable_Table = Source{[Item="ParameterTable",Kind="Table"]}[Data],
// Transpose it: Rows become columns and vice versa
#"Transposed Table" = Table.Transpose(ParameterTable_Table),
// First row is the name of the parameters: Turn it into column names
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
// Turn the table in a list of records (with only 1 element)
Custom1 = Table.ToRecords(#"Promoted Headers"),
// Access the first (and// only) element
Custom2 = Custom1{0}
in
// Return the record
Custom2
Producing this:
And I refferred to the P1 parameter from another query like this:
Hope this clarifies and helps...
Very doable.
You may have additional questions to apply these steps to your unique situation. Feel free to ask, but please include actual screenshots and/or the M-Code of the query you trouble with....
Have fun!
I took it a step further and give you an example.
I created this little table in Excel
I created the following query in aanother workbook
let
// Connect to the parameter workbook.
Source = Excel.Workbook(File.Contents("C:\.....\How to create a parameter library to use in different workbooks with PQ.xlsx"), null, true),
// Access the ParameterTable
ParameterTable_Table = Source{[Item="ParameterTable",Kind="Table"]}[Data],
// Transpose it: Rows become columns and vice versa
#"Transposed Table" = Table.Transpose(ParameterTable_Table),
// First row is the name of the parameters: Turn it into column names
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
// Turn the table in a list of records (with only 1 element)
Custom1 = Table.ToRecords(#"Promoted Headers"),
// Access the first (and// only) element
Custom2 = Custom1{0}
in
// Return the record
Custom2
Producing this:
And I refferred to the P1 parameter from another query like this:
Hope this clarifies and helps...
Thank you. Your codes helped. I tried and experience the following problem:
How can I get it works?
Try this:
It is not allowed by my company to ignore privacy level. Is there another way to solve it without changing security levels?
Or try what CoPilot gave me:
The Formula.Firewall error in Power Query occurs when there's a mismatch in the privacy levels of the data sources you're trying to combine1. To resolve this, you can set the privacy level of your Excel workbook to match the SQL Server2.
Here's how you can do it:
Open your Excel workbook3.
Go to the Data tab2.
Select Get Data > Query Options2.
In the Query Options dialog box, go to the Global section2.
Click on Privacy2.
Set the Privacy Level to match the SQL Server2. The options are:
Ignore privacy levels (not recommended for sensitive data)
Private
Organizational
Public4
To determine the correct privacy level for your SQL Server data, you'll need to check the sensitivity of the data2. If it contains highly sensitive or confidential information, you should set the privacy level to Private2. If it's less sensitive, you might choose Organizational or Public2.
Can you set the privacy level of the Excel to match the SQL privacy level?
I have never even tried it.... So I may be sending you on a goose chase...
You could also create the Parameters Table inside SQL_DB and follow same logic as @PwerQueryKees provided.
I would do it the same
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
6 | |
6 | |
6 | |
6 |
User | Count |
---|---|
9 | |
9 | |
8 | |
6 | |
6 |