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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
stevenamani
Advocate II
Advocate II

Filter Not Working (Javascript API)

I am using the Javascript API to embed a powerbi report however the filter is not affecting the result. The code is as follows:

 

function getFilters () {
const filter1 = {$schema: "http://powerbi.com/product/schema#basic",target: {table: "Users",column: "ID"},operator: "In",values: ["470"]};
var allFilters = [filter1];
return allFilters;
}

 

The above function is called from an updateEmbededDashboard function that contains

 

 report.getFilters()
                    .then(function(filters) {
                        
                        var allFilters = getFilters();

                        filters.push(allFilters);
                        
                        if (allFilters != null) return report.setFilters(allFilters);
                    }).catch (function (error) {
                        console.log(error.message);
                    });
1 ACCEPTED SOLUTION
stevenamani
Advocate II
Advocate II

In case anyone else comes accross this:

 

The issue was having the numeric value in double quotes. Instead of 

 

 

operator: "In",values: ["470"]};

It should be

operator: "In",values: [470]};

 

View solution in original post

1 REPLY 1
stevenamani
Advocate II
Advocate II

In case anyone else comes accross this:

 

The issue was having the numeric value in double quotes. Instead of 

 

 

operator: "In",values: ["470"]};

It should be

operator: "In",values: [470]};

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.