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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
danieleperilli
Kudo Commander
Kudo Commander

Advanced Filter

I'm trying to use the AdvancedFilter feature in my visual, but something is not clear to me.

I'm using the following code:

let inValues = [];
let containsValue = '';

let conditions = [];
for (let i = 0; i < inValues.length; i++)
    conditions.push({
        operator: 'Is',
        value: inValues[i]
    });
conditions.push({
    operator: 'Contains', 
    value: containsValue
});
let advancedFilter = new window['powerbi-models'].AdvancedFilter({
    table: TABLE_NAME,
    column: COLUMN_NAME
}, (conditions.length > 1 ? 'Or' : 'And'), conditions);
host.applyJsonFilter(advancedFilter, 'general', 'filter', FilterAction.merge);

After the last line, the filter is applied correctly to the report, but my visual does not receive a filtered data in the subsequently update. 

Is it normal?

1 ACCEPTED SOLUTION
v-viig
Community Champion
Community Champion

Hi @danieleperilli,

 

This is expected behavior as a filter is applied to other visuals on the same report page.

A custom visual that applies a filter will not get the filtered data.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

[email protected]

View solution in original post

5 REPLIES 5
v-viig
Community Champion
Community Champion

Hi @danieleperilli,

 

This is expected behavior as a filter is applied to other visuals on the same report page.

A custom visual that applies a filter will not get the filtered data.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

[email protected]

Thanks @v-viig.

It would useful to have the filtered data as separated node in the dataviews returned in the update. Is it something you could evaluate to insert in the future? 

Could you please describe why your custom slicer should receive a filtered data?

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

[email protected]

If the slicer receives the filtered data, it can be used to perform advanced search and display results without loading all the rows from the dataset. 

We'll send this  idea to PBI CV API team for consideration.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

[email protected]

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors