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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
eirika
Frequent Visitor

Default value for parameter in workspace

I have 2 customers with one wokspace each.

The report I publish to both workspaces has a paramter named CustomerID that is used to filter in the SQL to only include data related to the Customer in each workspace. When I publish the report I need to go to settings on the dataset to configure the Parameter to the correct value for each workspace.

 

If I need to deploy 10 reports to each workspace, then I need to configure the CustomerID for each report.

 

Is there any way to set this variable with a default value for the workspace?

This way I would be able to say that variable CustomerID in Workspace_1 should default to 1 for all reports, and CustomerID in Workspace_2 should default to 2 for all reports.

 

3 REPLIES 3
conorh-dev
Frequent Visitor

I have a similar requirement and would love to see an easy solution to implement and maintain this. 

It seems like the ideal solution would be able to set the parameter values on the workspace so that when a generic, parameterised report or dataflow is deployed to a workspace that it would just read in the parameter values on that workspace. This does not appear to be how this works in PowerBI though. 

The way I am going to approach it now looks like we will parameterise all the reports to point to a named dataset so that when we deploy between workspaces we will only need to update the parameter values on the dataset, based on some kind of convention on the workspace name maybe, with Azure Automation or some other kind of hook.

I found this earlier and will need to look through it but I hope there is a much easier solution to doing all of this because it seems like a lot of additional work to achieve what seems like a simple ask to maintain multiple customer workspaces from one development/production workspace. 

Overview of Power BI deployment pipelines - Power BI | Microsoft Learn


 

eirika
Frequent Visitor

Hi Otravers,

Thanks for your reply. This is a nice way to increase performance but it will not solve my issue. I already have the parameter in the query. My report is deployed to 2 different workspaces where I need to set the parameter to different values. When I create a new report this will include the same parameter and when the new report is deployed I need to edit the dataset settings to set the parameter value once again for each workspace. But the name and value of the parameter is equal for all reports in the same workspace.

 

A realy nice feature would be to set a workspace paramter and if a report in the workspace uses the same name as the workspace parameter it will get that value.

otravers
Community Champion
Community Champion

Look into dynamic M parameters:

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters

https://blog.crossjoin.co.uk/2022/02/20/tsql-table-valued-functions-and-dynamic-m-parameters-in-powe...

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors