Forum Discussion
Parameter selection to table
Hi kodiejames13 ,
Yes, you can achieve this in Power BI using OLS & RLS as AnkitaaMishra said below,
I have edited this reply for paginate report as well below
I have done this with a combination of Field Parameters and Dynamic Column Visibility logic. Since your report is sent via subscriptions here's a step-by-step breakdown. (No idea that OLS or RLS will apply for each user via email)
Create a Field Parameter for Dynamic Column Selection
- Go to the Modeling tab > Select New Parameter > Choose Fields.
- Add the required columns (e.g., Column 1, Column 2, etc.).
- Rename the parameter table (e.g., ClientColumnParameter).
- Power BI will create a slicer for dynamic column selection.
Define a Supporting Table for Clients Create a table to map Clients to their respective columns.
ClientColumnMapping = DATATABLE( "Client", STRING, "ColumnsToShow", STRING, { {"Client A", "1,2,3,4,5"}, {"Client B", "2,4,5"}, {"Client C", "3,4,5"}, {"Client D", "2,4"} } )This maps the client name to a comma-separated list of columns.
Build Logic for Column Visibility
- Create a calculated table or DAX measure to dynamically filter columns based on the selected client:
SelectedColumns = VAR SelectedClient = SELECTEDVALUE('ClientColumnMapping'[Client]) RETURN SWITCH( SelectedClient, "Client A", "1,2,3,4,5", "Client B", "2,4,5", "Client C", "3,4,5", "Client D", "2,4", BLANK() )
- Create a calculated table or DAX measure to dynamically filter columns based on the selected client:
Apply Filters Dynamically in the Table
- Use a Matrix Visual instead of a Table visual for flexibility.
- Place the Fields Parameter in Columns of the Matrix.
- Use a slicer for ClientColumnMapping to filter the selected columns dynamically.
Test Behavior
- When you select a client in the slicer, the columns should adjust to display only their respective values.
_____
Solution: Power BI Report Builder (Paginated Reports)
Since Power BI Report Builder does not support dynamic column hiding like Power BI Desktop, use conditional visibility logic:
Add a Parameter for Client Selection
- In Report Builder, create a Client parameter with values "Client A," "Client B," etc.
Conditionally Hide Columns
- In your report's Table:
- Right-click on a column > Select Column Visibility.
- Use the following expressions to show/hide columns:
- Column 1: =IIF(Parameters!Client.Value = "Client A", False, True)
- Column 2: =IIF(Parameters!Client.Value IN ("Client A", "Client B", "Client D"), False, True)
- Repeat this for other columns with their respective logic.
- In your report's Table:
Subscription Email
- When you set up the email subscription, the chosen parameter values (Client A, B, etc.) will determine which columns are visible in the final emailed report.