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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
ayush-mishra
Regular Visitor

Updating filter via JS results in duplication of filters in filter pane

Hi, 

 

Actually I am trying to update a filter in an embedded report for customer. 

let ufilter = {
    "$schema": "http://powerbi.com/product/schema#basic",
    "target": {
        "table": "factGroup",
        "column": "Regulated/Unregulated",
        "groupedColumns": [
            {
                "table": "factGroup",
                "column": "Legal Status"
            }
        ]
    },
    "filterType": 1,
    "operator": "In",
    "values": [
        "Regulated"
    ],
    "requireSingleSelection": false
}

await report.updateFilters(models.FiltersOperations.Replace, [ufilter])

 

This is causing the original filter that needs to be updated remain unaffected and adds a complete new filter for the same column with Regulated value. 
This doesn't look good as it's causing the duplicate column in filter pane.

Is there anyway I can fix this? Also, what is the purpose of "groupedColumn" target?

 

Thanks

 

1 ACCEPTED SOLUTION

Hi @ayush-mishra ,

Glad to know the original duplicate issue is fixed.
The groupedColumns property is an optional part of the Power BI JavaScript filter schema and is intended to support grouped or derived columns. It does not affect standard report-level filtering and is often dropped when filters are normalized by the service.


Thank you

View solution in original post

5 REPLIES 5
v-nmadadi-msft
Community Support
Community Support

Hi @ayush-mishra 

May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions.


Thank you

v-nmadadi-msft
Community Support
Community Support

Hi @ayush-mishra 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.


Thank you.

v-nmadadi-msft
Community Support
Community Support

Hi @ayush-mishra ,
Thanks for reaching out to the Microsoft Fabric Community forum.


The Replace filter API you are trying to use is not supported for report level, but is supported for Page level and visual level.
Instead of using Replace filter API, Please try removing the undesired filter first and then add the required filter using the API mentioned in the screenshot.

vnmadadimsft_0-1770115665943.png

Source:Use filters in a Power BI embedded analytics report | Microsoft Learn

I hope this information helps. Please do let us know if you have any further queries.
Thank you



 

Hi,

Thanks for replying.

I tried removing all the report filters and then re-adding them.

await report.updateFilters(models.FiltersOperations.RemoveAll)

let ufilter = {
    "$schema": "http://powerbi.com/product/schema#basic",
    "target": {
        "table": "factGroup",
        "column": "Regulated/Unregulated",
        "groupedColumns": [
            {
                "table": "factGroup",
                "column": "Legal Status"
            }
        ]
    },
    "filterType": 1,
    "operator": "In",
    "values": [
        "Regulated"
    ],
    "requireSingleSelection": false
}

await report.updateFilters(models.FiltersOperations.Add, [ufilter])

Using this approach resolved the duplication issue.
But now, when I get the filters using 

const updatedFilters = await report.getFilters()

the updated filter doesn't have groupedColumn target.

{
    "$schema": "http://powerbi.com/product/schema#basic",
    "target": {
        "table": "factGroup",
        "column": "Regulated/Unregulated"
    },
    "filterType": 1,
    "operator": "In",
    "values": [
        "Regulated"
    ],
    "requireSingleSelection": false
}

 

I am not exactly sure how this groupedColumn target affects the report visual.
Any idea on what it does? Does it affect the report visuals?

Hi @ayush-mishra ,

Glad to know the original duplicate issue is fixed.
The groupedColumns property is an optional part of the Power BI JavaScript filter schema and is intended to support grouped or derived columns. It does not affect standard report-level filtering and is often dropped when filters are normalized by the service.


Thank you

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.