Skip to main content

Report Filters Overview

Report filters define Power BI filter configurations that can be applied to reports. Filters target specific tables and columns with operators and values.

List All Filters

Retrieve all available report filters.
GET /reports/filters

Authentication & Permissions

Authorization
string
required
Valid session or Sanctum token
Requires one of:
  • super-admin role
  • report.filter.index permission
  • report.filter.create permission
  • report.filter.update permission
  • report.filter.destroy permission

Response

filters
array
Array of all filter objects
filters[].id
integer
Filter ID
filters[].name
string
Filter display name
filters[].table
string
Power BI table name
filters[].column
string
Power BI column name
filters[].operator
string
Filter operator (In, NotIn, Equals, Contains, etc.)
filters[].values
string
Raw filter values (comma-separated for β€˜In’ operator)
filters[].parse_values
array|string
Parsed values (array for β€˜In’, string for others)
filters[].created_at
datetime
Creation timestamp

Example Request

curl -X GET https://your-domain.com/reports/filters \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Example Response

{
  "filters": [
    {
      "id": 1,
      "name": "Region Filter",
      "table": "Sales",
      "column": "Region",
      "operator": "In",
      "values": "North,South,East",
      "parse_values": ["North", "South", "East"],
      "created_at": "2026-01-20 10:30:00 AM"
    },
    {
      "id": 2,
      "name": "Year Filter",
      "table": "Date",
      "column": "Year",
      "operator": "Equals",
      "values": "2026",
      "parse_values": "2026",
      "created_at": "2026-01-20 11:15:00 AM"
    }
  ]
}

Create Filter

Create a new report filter.
POST /reports/filters

Request Body

name
string
required
Descriptive name for the filter
table
string
required
Power BI table name to filter
column
string
required
Power BI column name to filter
operator
string
required
Filter operator
values
string
required
Filter values (comma-separated for β€˜In’ operator)

Supported Operators

  • In - Match any value in list (values: β€œValue1,Value2,Value3”)
  • NotIn - Exclude values in list
  • Equals - Exact match (values: β€œSingleValue”)
  • Contains - Substring match
  • GreaterThan - Numeric comparison
  • LessThan - Numeric comparison
  • GreaterThanOrEqual - Numeric comparison
  • LessThanOrEqual - Numeric comparison

Example Request

curl -X POST https://your-domain.com/reports/filters \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Product Category Filter",
    "table": "Products",
    "column": "Category",
    "operator": "In",
    "values": "Electronics,Furniture,Clothing"
  }'

Example Response

Returns array of all filters including the newly created one (200 status).
[
  {
    "id": 1,
    "name": "Region Filter",
    "table": "Sales",
    "column": "Region",
    "operator": "In",
    "values": "North,South,East",
    "parse_values": ["North", "South", "East"]
  },
  {
    "id": 3,
    "name": "Product Category Filter",
    "table": "Products",
    "column": "Category",
    "operator": "In",
    "values": "Electronics,Furniture,Clothing",
    "parse_values": ["Electronics", "Furniture", "Clothing"]
  }
]

Update Filter

Update an existing report filter.
PUT /reports/filters/{id}

Path Parameters

id
integer
required
Filter ID to update

Request Body

Same fields as create (all optional):
name
string
Updated filter name
table
string
Updated table name
column
string
Updated column name
operator
string
Updated operator
values
string
Updated values

Example Request

curl -X PUT https://your-domain.com/reports/filters/3 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "values": "Electronics,Furniture,Clothing,Appliances"
  }'

Response

Returns array of all filters with updates applied (200 status).

Delete Filter

Delete a report filter.
DELETE /reports/filters/{id}

Path Parameters

id
integer
required
Filter ID to delete

Example Request

curl -X DELETE https://your-domain.com/reports/filters/3 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Response

Returns array of remaining filters (200 status).

Filter Application

Filters are applied to reports through the pivot table pvt_report_user_filters:

Assign Filters to User Report

Filters are assigned per user-report combination. See User Management API for filter assignment.

Power BI Filter Schema

When applied to a report, filters are converted to Power BI filter objects:
{
  "$schema": "http://powerbi.com/product/schema#basic",
  "target": {
    "table": "Products",
    "column": "Category"
  },
  "operator": "In",
  "values": ["Electronics", "Furniture", "Clothing"]
}

Multiple Filters

Multiple filters are combined as an array:
[
  {
    "$schema": "http://powerbi.com/product/schema#basic",
    "target": { "table": "Products", "column": "Category" },
    "operator": "In",
    "values": ["Electronics"]
  },
  {
    "$schema": "http://powerbi.com/product/schema#basic",
    "target": { "table": "Sales", "column": "Region" },
    "operator": "In",
    "values": ["North", "South"]
  }
]

Error Responses

500 Internal Server Error

{
  "message": "Error message from exception"
}

403 Forbidden

{
  "message": "This action is unauthorized."
}

Implementation Notes

Source: app/Http/Controllers/ReportFilterController.php

Model

Source: app/Models/ReportFilter.php Fillable fields:
  • name, table, column, operator, values

Parse Values Accessor

The parse_values attribute automatically parses values:
  • Operator = β€˜In’: Splits comma-separated string into array
  • Other operators: Returns lowercase string
public function getParseValuesAttribute(): array|string
{
    return $this->operator === 'In' 
        ? explode(',', $this->values) 
        : strtolower($this->values);
}

Build docs developers (and LLMs) love