Forum Discussion

SaurabhSk's avatar
SaurabhSk
New Member
1 year ago

Set slicers from react to power bi embedded

I am implementing the Powerbi embedded dashboard in my React application.
In my Powerbi Dashboard, I have plenty of slicer from which I am manipulating data and visuals. I want to set the slicers from the react component but not able to set the slicers..

 const slicer_filter =
    {
        state: {
            filters: [
                {
                    $schema:    ,
                    target: {
                        table: 'Query1',
                        column: 'dealer_id',
                    },
                    operator: 'In',
                    values: ["0102"],
                    filterType: models.FilterType.BasicFilter,
                },
            ],
        }
    };

Called this slicers in embed config.
 <PowerBIEmbed
                    embedConfig={{
                        type: supportType,
                        id: reportID,
                        embedUrl: embeddedURL,
                        accessToken: token.token,
                        tokenType: models.TokenType.Embed,
                        slicers: [slicer_filter],
}}
  cssClassName={
                        "Embed-container"
                    }

                    getEmbeddedComponent={(embeddedReport) => {
                        window.Report = embeddedReport;
                    }}
                />


Any help would be appreciated, Thanks
powerbiembedded PowerBI Azure 

3 Replies