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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
SaurabhSk
New Member

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 3
SaurabhSk
New Member

Hi @v-shex-msft

So basically I have gone thorugh this document plenty of time but if I want to update the slicers I am not getting any exact solution for this.

I even tried the same in Powerbi embed playground Power BI Playground - Developer Sandbox
Still not getting a good picture of this 

 

Hi @SaurabhSk,

I think you can take a look at the following document about handle events and invoke and modify the filters in these events:

How to handle events in a Power BI embedded analytics application | Microsoft Learn

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

Hi @SaurabhSk,

I'd like to suggest you take a look at the following document about how to control the filter based on client api:

Use filters in a Power BI embedded analytics report | Microsoft Learn
Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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