Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Emma_
Helper II
Helper II

Power Query Parameters Selected Value in a Table / Report View

Hi everyone,

I am using a parameter in Power BI to control from which data source I load the data before loading it into the model (for example: Source Environement Preprod vs Prod). This works fine for loading, but I would like the selected parameter value to be visible in the report view so that testers can always see where the data is coming from.

In other words:
  • I choose the data source via a parameter in Power Query.
  • I then load the data into the model.
  • I want to display somewhere in the report which data source was selected in that parameter when the data was last refreshed.
Is there a way to:
  • Transform the selected parameter value into a column or table that is loaded into the data model or
  • Otherwise make the parameter value available in a measure or table so it can be shown on the report?
Any examples (Power Query M or DAX) or best practices to achieve this would be appreciated.
 
Thank you.
 

Emma__1-1772787594322.png

 

 

1 ACCEPTED SOLUTION
jennratten
Super User
Super User

Hello @Emma_ - thanks for posting in the Fabric Community.  

Below is one way you can get the outcome you are expecting.  Please let me know if you have any questions.

In this example I am creating a table which displays the email addresses from the parameter paramTesterEmails split into separate rows (one per email), with two additonal columns populated by the parameters paramTesterRoleId and paramClientEntityId.

 

Parameters in Power Query:

jennratten_0-1772788471752.png

 

Create a new function:

For your use case you can simply replace the parameter names with your real parameter names as well as what you'd like your columns to be named.

let
    fn = ( ) =>
let
    Source = Text.Split(paramTesterEmails,","),
    ListToTable = Table.FromList(Source, Splitter.SplitByNothing(), {"UPN"}, null, ExtraValues.Error),
    ChangeTypes = Table.TransformColumnTypes(ListToTable,{{"UPN", type text}}),
    AddId = Table.AddColumn(ChangeTypes, "TesterRoleId", each paramTesterRoleId, Int64.Type),
    ClientEntityId = Table.AddColumn ( AddId, "ClientEntityId", each paramClientEntityId, Int64.Type )
in
    ClientEntityId
in
    fn

 Then invoke the function to produce the table:

jennratten_1-1772788756483.png

 

If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.

Proud to be a Microsoft Fabric Super User

 

View solution in original post

4 REPLIES 4
Emma_
Helper II
Helper II

It is really amazing, thank you so much for your quick response and a great solution !

You are very welcome!

rohit1991
Super User
Super User

Hii @Emma_ 

 

The selected Power Query parameter value can be exposed in the report by creating a small query that returns the parameter as a table and loading it into the model. In Power Query, create a new blank query and use M like:

= #table({"Environment"}, {{ParameterName}})

Load this query to the model and create a card, table, or measure in the report to display it. After every refresh, the table will show the currently selected parameter value (e.g., Preprod or Prod), allowing users to clearly see which data source the report was loaded from.

check the link below:-

https://learn.microsoft.com/en-us/power-query/power-query-query-parameters 

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
jennratten
Super User
Super User

Hello @Emma_ - thanks for posting in the Fabric Community.  

Below is one way you can get the outcome you are expecting.  Please let me know if you have any questions.

In this example I am creating a table which displays the email addresses from the parameter paramTesterEmails split into separate rows (one per email), with two additonal columns populated by the parameters paramTesterRoleId and paramClientEntityId.

 

Parameters in Power Query:

jennratten_0-1772788471752.png

 

Create a new function:

For your use case you can simply replace the parameter names with your real parameter names as well as what you'd like your columns to be named.

let
    fn = ( ) =>
let
    Source = Text.Split(paramTesterEmails,","),
    ListToTable = Table.FromList(Source, Splitter.SplitByNothing(), {"UPN"}, null, ExtraValues.Error),
    ChangeTypes = Table.TransformColumnTypes(ListToTable,{{"UPN", type text}}),
    AddId = Table.AddColumn(ChangeTypes, "TesterRoleId", each paramTesterRoleId, Int64.Type),
    ClientEntityId = Table.AddColumn ( AddId, "ClientEntityId", each paramClientEntityId, Int64.Type )
in
    ClientEntityId
in
    fn

 Then invoke the function to produce the table:

jennratten_1-1772788756483.png

 

If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.

Proud to be a Microsoft Fabric Super User

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.