Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Power BI dataset filter in Create Report Embed option

 

I found the solution to apply the filter option on existion report but I did not find any option to apply the filter when user is creating report using dataset id.

 

I am trying to set filter on power bi report in create mode. I found the example to set the filter on dataset at report level, page level and visual level but the filter is not working when embed setting is for report creation (Create mode)

 

Please find the below code which is for power bi report creation.

 

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]);
});

 

0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors