Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powerbi 创建报告模式下的Power BI数据集筛选器_Powerbi_Powerbi Embedded_Powerbi Datasource - Fatal编程技术网

Powerbi 创建报告模式下的Power BI数据集筛选器

Powerbi 创建报告模式下的Power BI数据集筛选器,powerbi,powerbi-embedded,powerbi-datasource,Powerbi,Powerbi Embedded,Powerbi Datasource,我正在尝试在创建模式下对power bi报告设置过滤器。我发现这个示例可以在报表级别、页面级别和可视级别对数据集设置过滤器,但当嵌入设置用于报表创建(创建模式)时,过滤器不起作用 请查找以下用于创建power bi报告的代码。 加载数据集以创建图表时,是否有其他方法过滤数据?而不是通过调用embeddeobject.setFilter([iFilter])来设置过滤器运行时,您可以直接在嵌入式配置中定义过滤器: const配置={ 过滤器:[iFilter],您可以直接在嵌入式配置中定义过滤

我正在尝试在创建模式下对power bi报告设置过滤器。我发现这个示例可以在报表级别、页面级别和可视级别对数据集设置过滤器,但当嵌入设置用于报表创建(创建模式)时,过滤器不起作用

请查找以下用于创建power bi报告的代码。


加载数据集以创建图表时,是否有其他方法过滤数据?

而不是通过调用
embeddeobject.setFilter([iFilter])来设置过滤器运行时,您可以直接在嵌入式配置中定义过滤器:

const配置={

过滤器:[iFilter],您可以直接在嵌入式配置中定义过滤器,而不是通过调用
EmbeddeObject.setFilter([iFilter]);
来设置过滤器运行时:

const配置={

筛选器:[iFilter],Andrey,我尝试了上述代码,但在创建模式下无效。它仅适用于现有报表。Andrey,我尝试了上述代码,但在创建模式下无效。它仅适用于现有报表。

var embedDiv = document.getElementById('embedDiv');

const iFilters: IBasicFilter = {
        $schema: 'http://powerbi.com/product/schema#basic',
        filterType: FilterType.Basic,
        target: {
            column: 'COLUMN1',
            table: 'TABLE1'
        },
        operator: 'In',
        values: ['VALUE1', 'VALUE2'],
    };

const configuration = {
              'accessToken': 'ae...ex',
              'embedUrl': 'https://app.powerbi.com//reportEmbed?groupId=group_id',
              'datasetId': 'aex....mky'
              };

// The below line gives Create Object.
const embedObject = this.powerBIService.createReport(embedDiv, configuration );

embedObject.on('loaded', function(e){

// the below line gives error because setFilter is a method of Report instead of Create class.
          embedObject.setFilter([iFilter]);
});
const configuration = {
    filters: [iFilter],                           <-- add this line
    'accessToken': 'ae...ex',
    'embedUrl': 'https://app.powerbi.com//reportEmbed?groupId=group_id',
    'datasetId': 'aex....mky'
};