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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to change Power BI source using parameter

Hello,
I have a report which should be produced by different users simultaneously for different clients.
the report should be based on temporary tables in SQL that retrieves the relevant data for each user logged in to the application
my goal is to change the source of the component in Power BI using parameter which is contains the user name (from query).
I need to concatenate the username parameter to the end of the table name.

let
Source = Sql.Database("pgwmdb01", "PMS"),
dbo_PBIBalances = Source{[Schema="dbo",Item="PBIBalances"]}[Data],
result = if (UserName="") then dbo_PBIBalances else Text.Combine("PBIBalances",UserName)
in
result


for example:
"PBIBalances" should be replaced by "PBIBalances_Ziva"
I'm not familiar with Power BI coding, but tried to use function text.combine to concatenate the parameter with the table name, but I get an error.
Expression.Error: We cannot convert the value "PBIBalances" to type List.
Please your advice how can I solve this issue or if there is any other way to achieve this.

Thanks,

1 REPLY 1
v-yadongf-msft
Community Support
Community Support

Hi @Anonymous 

 

This article maybe helpful to solve your problem. For your reference:

Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.