cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Apply JSON Filter to own custom visual

Hey,

 

I'm trying to build a new version of our custom visual because I saw other custom visuals (apparently) applying json filters to themself. How can I achive this behaviour and apply a json filter (advanced filter api) to the visual itself which created the filter?

 

regards,

lucmax

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

With help of a fellow forum member I got it to work the way I want. You need to do the following to have your visual filter itself AND others visuals:

 

capabilities.json (general)

 

            "properties": {
                "filter": {
                    "type": {
                        "filter": true
                    }
                },
                "selfFilter": {
                    "type": {
                       "filter": {
                          "selfFilter": true
                       }
                    }
                 }
            }

 

ApplyJsonFilter call(s)

    this._visualHost.applyJsonFilter(
      filterList,
      "general",
      "selfFilter",
      powerbi.FilterAction.merge
    );
    this._visualHost.applyJsonFilter(
      filterList,
      "general",
      "filter",
      powerbi.FilterAction.merge
    );

 

Hope this helps someone else!

View solution in original post

1 REPLY 1
Highlighted
Helper I
Helper I

With help of a fellow forum member I got it to work the way I want. You need to do the following to have your visual filter itself AND others visuals:

 

capabilities.json (general)

 

            "properties": {
                "filter": {
                    "type": {
                        "filter": true
                    }
                },
                "selfFilter": {
                    "type": {
                       "filter": {
                          "selfFilter": true
                       }
                    }
                 }
            }

 

ApplyJsonFilter call(s)

    this._visualHost.applyJsonFilter(
      filterList,
      "general",
      "selfFilter",
      powerbi.FilterAction.merge
    );
    this._visualHost.applyJsonFilter(
      filterList,
      "general",
      "filter",
      powerbi.FilterAction.merge
    );

 

Hope this helps someone else!

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors