Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Operations Management Interface

Power BI basic filter scripts

  • Last UpdatedJul 18, 2024
  • 3 minute read

Basic filter methods can set a data filter with a single operator on a Power BI report or a page.

SetBasicReportFilter()

A basic filter has a single operator with one or more values. A basic filter script can be specified in layout scripts.

SetBasicReportFilter(string tableName, string columnName, string filterOperator, string values, string displayName, bool isHiddenInViewMode, bool isLockedInViewMode, bool requireSingleSelection, bool update = false)

SetBasicReportFilter() Parameters

  • tableName

    Name of the Power BI report table containing the data to be filtered in the report.

  • columnName

    Name of the column within the Power BI report table containing the data to be filtered in the report.

  • filterOperator

    A basic filter script operator can be one of the following: "In" | "NotIn" | "All"

  • values

    An array of values for the filter. All values must be of the same data type. Multiple values must be separated by a pipe ‘|’ symbol.

  • displayName

    A filter can be displayed in the filter pane with a personalized name. When the value is undefined or null, the default name of the filter will be displayed (typically the name of the filtered data field).

  • isHiddenInViewMode

    Boolean value that determines if a hidden filter is applied to the report but not displayed in the filter pane in view mode. Set to true to hide the filter.

  • isLockedInViewMode

    Boolean value that determines if a filter lock is applied and displayed in the filter pane. The filter value cannot be changed in view mode. Set to true to lock the filter.

  • requireSingleSelection

    Boolean value that determines whether multiple values can be assigned to a filter or not.If set to true, only a single value can be selected. This parameter is available only for Basic filters.

  • update

    Boolean value that determine whether multiple filters can be set. When update is true, a new filter will be added to the existing filters. If set to false, the existing filters are replaced.

    Example

    The following script statements remove existing filters and update the script with two new filters.

    SetBasicReportFilter("Time","FiscalMonth","In", "Oct|Dec", false);

    SetBasicReportFilter("Store","City","In", "Cary, NC", true);

Example

MyContent.PBIViewerCntrl.SetBasicReportFilter("Time","FiscalMonth","In", "Feb", "MBF1",false, true,true);

This statement filters data from the FiscalMonth column of Time table to show data for the month of February. A personalized name of MBF1 has been assigned to the filter and a lock has been applied to it.

SetBasicPageFilter()

A basic filter can also be applied to a Power BI report page. The report page name is passed in as the first parameter of the method.

SetBasicPageFilter(string pageName, string tableName, string columnName, string filterOperator, string values, string displayName, bool isHiddenInViewMode, bool isLockedInViewMode, bool requireSingleSelection, bool update = false)

SetBasicPageFilter() Parameters

The SetBasicPageFilter() method includes the same parameters as the SetBasicReportFilter() method and the additional pageName parameter.

  • pageName

    Name of the Power BI report page that displays the data to be filtered in the report.

  • tableName

    Name of the Power BI report table containing the data to be filtered in the report.

  • columnName

    Name of the column within the Power BI report table containing the data to be filtered in the report.

  • filterOperator

    A basic filter script operator can be one of the following: "In" | "NotIn" | "All"

  • values

    An array of values for the filter. All values must be of the same data type. Multiple values must be separated by a pipe ‘|’ symbol.

  • displayName

    A filter can be displayed in the filter pane with a personalized name. When the value is undefined or null, the default name of the filter will be displayed (typically the name of the filtered data field).

  • isHiddenInViewMode

    Boolean value that determines if a hidden filter is applied to the report but not displayed in the filter pane in view mode. Set to true to hide the filter.

  • isLockedInViewMode

    Boolean value that determines if a filter lock is applied and displayed in the filter pane. The filter value cannot be changed in view mode. Set to true to lock the filter.

  • requireSingleSelection

    Boolean value that determines whether multiple values can be assigned to a filter or not.If set to true, only a single value can be selected. This parameter is available only for Basic filters.

  • update

    Boolean value that determine whether multiple filters can be set. When update is true, a new filter will be added to the existing filters. If set to false, the existing filters are replaced.

Example

MyContent.PBIViewerCntrl.SetBasicPageFilter("Page3","Time","FiscalMonth","In", "Oct|Dec","MyFilter1",true,false,false);

This statement filters data for the months of October through December that appears on Page3 of the Power BI report. A personalized name of MyFilter1 has been assigned to the filter and it is hidden and does not appear on the Filters page.

TitleResults for “How to create a CRG?”Also Available in