Forum Discussion
Looping for multivalued in power Bi report builder
- 1 year ago
Hi Aartibhilare ,
Thanks for reaching out to Microsoft Fabric Forum Community,
To meet your requirements ,you can use the following approach:
You can create Multi-value parameters, Create Conditional Report Views and Control Visibility Dynamically.
Step 1: Create a Multi-Value Parameter
In your Power BI report, create a parameter (e.g., CompanyParameter) and check Allow multiple values. This will be linked to your slicer for selecting the company names.Step 2: Add a Dataset to Fetch the Selected Companies
- Create a dataset (e.g., SelectedCompanies) to capture the selected values of the parameter.
- Use an expression to convert the selected companies into a comma-separated list for visibility logic.
Example SQL :
SELECT CompanyName
FROM Companies
WHERE CompanyName IN (@CompanyParameter)
Step 3: Create Conditional Report Views- SingleView: For individual company selections.
- MultiView: For multiple company selections.
Step 4: Control Visibility Dynamically
- Set the visibility of the different report views based on the parameter.
For SingleView:
=IIF(Parameters!CompanyParameter.Count > 1, True, False)
For MultiView:
=IIF(Parameters!CompanyParameter.Count = 1, True, False)
Run the report and test the slicer selection,
If you need further assistance please reach out.
Hope this works for you,
Please consider giving a kudos and accept as solution to help others find it.Thank you.
Hi v-karpurapud
do you have any idea on this?