Overview
The Report Filter Management module allows administrators to create reusable filter definitions that can be applied to Power BI reports on a per-user basis. Filters control what data users can see when viewing reports. Controller:ReportFilterController (app/Http/Controllers/ReportFilterController.php:12)Model:
ReportFilter (app/Models/ReportFilter.php:8)Vue Component:
resources/js/Pages/Report/Filter.vue
Key Features
Filter Definition
Define filters by table, column, operator, and values
Reusable Filters
Create filters once, apply to multiple users and reports
Multiple Operators
Support for In, Equals, Contains, and comparison operators
Value Parsing
Automatic value parsing for single and multi-value filters
Data Model
TheReportFilter model defines filter configurations:
Value Parsing
The model includes a computed attribute that parses values based on operator:- If operator is
In: Split comma-separated string into array - Otherwise: Return lowercase string value
Filter Operators
Supported Power BI filter operators:Membership Operators
- In: Value is in the list (requires array of values)
- NotIn: Value is not in the list (requires array of values)
Equality Operators
- Equals: Value equals exactly
- NotEquals: Value does not equal
String Operators
- Contains: String contains substring
- DoesNotContain: String does not contain substring
- StartsWith: String starts with
- DoesNotStartWith: String does not start with
Comparison Operators
- GreaterThan: Numeric or date greater than
- GreaterThanOrEqual: Greater than or equal to
- LessThan: Numeric or date less than
- LessThanOrEqual: Less than or equal to
Operator names match the Power BI JavaScript SDK filter schema exactly.
API Endpoints
List Filters
filters: Collection of all report filters
report.filter.index OR report.filter.create OR report.filter.update OR report.filter.destroy
Create Filter
- Validate filter definition
- Create new filter record
- Return updated filters list
report.filter.create
Update Filter
id field is automatically excluded from the update payload.
Response: JSON array of all filters (200) or error message (500)
Implementation: ReportFilterController.php:45-56
Permission Required: report.filter.update
Delete Filter
- Delete filter record
- Remove filter assignments from users
- Return remaining filters
report.filter.destroy
Deleting a filter removes it from all users and reports where it was applied.
Filter Application
Filters are applied to reports through a many-to-many relationship:Pivot Table: pvt_report_user_filters
Columns:
report_id: Foreign key to reportsuser_id: Foreign key to usersfilter_id: Foreign key to report_filters
- Multiple filters per user/report combination
- Same filter applied to different users
- Same filter applied to different reports
Assigning Filters to Users
Filters are assigned through the User Management interface:Retrieving User Filters
TheReport model includes a relationship that retrieves filters for the authenticated user:
Power BI Filter Schema
Filters are converted to Power BI’s filter schema when embedding reports:Schema Components
$schema: Alwayshttp://powerbi.com/product/schema#basic
target: Identifies the data to filter
table: Table name in the datasetcolumn: Column name in the table
- Array for
InandNotInoperators - Single value for other operators
Conversion in Code
TheReport model’s filter_array accessor performs the conversion:
Filter Examples
Example 1: Regional Sales Filter
Use Case: Restrict sales managers to see only their regions.Example 2: Product Category Filter
Use Case: Show specific product categories to product managers.Example 3: Date Range Filter
Use Case: Restrict historical data access.Example 4: Exclude Test Data
Use Case: Hide test/demo accounts from production reports.User Interface
The filter management interface provides:Filters Table
- Columns: Name, Table, Column, Operator, Values, Actions
- Actions: Edit, Delete
- Create Button: Opens modal for new filter
Filter Form (Create/Edit)
- Name: Display name for the filter
- Table: Power BI dataset table name
- Column: Column to filter
- Operator: Dropdown with available operators
- Values: Text input (comma-separated for
Inoperator) - Save Button: Submits form
- Cancel Button: Closes modal
Validation
Required Fields
- Name (unique, descriptive)
- Table (must match Power BI dataset)
- Column (must match table column)
- Operator (must be valid Power BI operator)
- Values (format depends on operator)
Value Format
ForIn and NotIn operators:
- Comma-separated list:
"Value1,Value2,Value3" - No spaces unless part of the value
- Example:
"North,South,East,West"
- Single value:
"North" - For dates: ISO format
"2026-01-01" - For numbers:
"1000"
Error Handling
Common errors and solutions:Invalid Table/Column
Error: Report fails to load or shows no data. Solution: Verify table and column names match exactly with Power BI dataset schema (case-sensitive).Invalid Operator
Error: Filter not applied, full data shown. Solution: Use exact operator names from Power BI schema (e.g., “In” not “in”).Malformed Values
Error: Filter syntax error in browser console. Solution: ForIn operator, ensure values are comma-separated without extra spaces.
Best Practices
Descriptive Names
Name filters clearly to indicate purpose: “Sales - Region North” not “Filter 1”.
Test Filters
Test filters with actual reports before assigning to production users.
Document Values
Keep documentation of valid values for each filter, especially for
In operators.Avoid Over-Filtering
Too many filters can make reports confusing. Use minimum necessary filters.
Filter Combination
Multiple filters applied to the same report are combined with AND logic: Example:- Filter 1: Region = “North”
- Filter 2: Year >= “2026”
Power BI applies all filters simultaneously. There is no OR logic support at the filter level.
Usage Workflow
Identify Filter Need
Determine what data restrictions are needed (e.g., regional access, time ranges).
Select Operator
Choose appropriate operator based on filter type (In for lists, Equals for single values, etc.).
Related Modules
Reports
Apply filters to Power BI reports
Users
Assign filters to specific users
Dashboard
View filtered reports on dashboard
Advanced: Dynamic Filters
For filters that need to change based on user attributes (e.g., filter by user’s assigned region):- Create filter with placeholder in values
- Implement custom logic in
PowerBITraitto replace placeholder - Apply dynamic value before generating embed token
Dynamic filter implementation requires custom code and is not included in the base module.