Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hey fellas. So, I am applying an advanced filter on a ranged date slicer and settings its state using the settings slicers in the report configuration. Issue is that, when i view this report in edit mode in a embedded page and hover over any visual's filters which are tied to the date, I can see the slicer filters of date being applied on it 2 times and this is preventing manual user changes on the said slicer to be applied to other concerned visuals. PFB the screenshot that I have attached for reference.
Appreciate any and all help to figure this thing out because its a really critical issues for us.
Solved! Go to Solution.
I think I found the issue. There is a hidden relative date slicer which also targets the same table and column as the date range advanced slicer and the slicer config that I passed in was targeting all the slicers with the target selector schema and because of that it seems to apply the fitlers twice on all the concerned visuals.
To fix this, I have adopted use of phased embedding and setting the date range slicer filters in the loaded event using the setSlicerState method. @DataNinja777 thanks for your help! Your way of fixing it had me think about this scenario as well 🙂
I think I found the issue. There is a hidden relative date slicer which also targets the same table and column as the date range advanced slicer and the slicer config that I passed in was targeting all the slicers with the target selector schema and because of that it seems to apply the fitlers twice on all the concerned visuals.
To fix this, I have adopted use of phased embedding and setting the date range slicer filters in the loaded event using the setSlicerState method. @DataNinja777 thanks for your help! Your way of fixing it had me think about this scenario as well 🙂
Hi @alohaes,
Thank you for reaching out in Microsoft Community Forum.
Thank you @DataNinja777 for the helpful response.
As suggested by DataNinja777, I hope this information was helpful. Please let me know if you have any further questions or you'd like to discuss this further. If this answers your question, please "Accept as Solution" and give it a 'Kudos' so others can find it easily.
Please continue using Microsoft community forum.
Regards,
Pavan.
Hi @alohaes ,
The issue is caused by applying the same filter twice—once through the slicer visual and again via JavaScript using settings.slicers or setFilters(). When both are applied on the same column, Power BI retains both filters and treats them as separate constraints, which locks the slicer from user interaction because it can't override a filter that's already applied programmatically. The solution depends on whether you want the slicer to be interactive or static.
If the slicer should be interactive and let the user control the date range, avoid applying the same filter through JavaScript. Don't use report.setFilters() or settings.slicers for the date column. Just rely on the slicer visual embedded in the report.
report.updateSettings({
slicers: [] // avoid setting slicer filter from JS if user interaction is needed
});
If the date should be fixed by JavaScript (e.g., for a rolling window), then apply the filter programmatically and either hide the slicer or remove it from the report so there's no conflict.
const dateFilter = {
$schema: "http://powerbi.com/product/schema#advanced",
target: {
table: "YourTableName",
column: "Date"
},
logicalOperator: "And",
conditions: [
{ operator: "GreaterThanOrEqual", value: "2025-04-23" },
{ operator: "LessThanOrEqual", value: "2025-05-23" }
],
filterType: models.FilterType.Advanced
};
report.setFilters([dateFilter]);
To confirm if duplicate filters are applied, use report.getFilters() and inspect the array. If you see two entries for the same Date column, that's your confirmation that the slicer and JS are both filtering it. Remove one to restore proper behavior.
Best regards,