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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Roboman
New Member

Custom Visual: Applying Filters

Hi all,

 

I'm working on a custom visual with an OpenLayers Map to better visualise spatial data. So far I've managed to filter and select data in other visuals and have the OpenLayers map react to the selection/filter (It zooms and highlights the selected data). The next is to be able to select something on the openLayers map and filter the other visuals. 

 

I am however unable to apply a selection with the selectionmanager or a filter with the JSONFilter method. I've created a fake filter and tried to apply this with no results at all. Nothing seems to happen. If I check the options of the update function the JSONFilters parameter remains empty. Am I doing something wrong? Any help would be greatly appreciated!

 

 

export class Visual implements IVisual {
  constructor(options: VisualConstructorOptions) {

  let testFilter = new models.AdvancedFilter(
    {
      table: 'Tablename',
      column: 'columnName'
    },
    "And",
    {
      operator: "StartsWith",
      value: "x"
    }
  );

  this.host.applyJsonFilter(testFilter, "general", "Filter", FilterAction.merge);
  }
}

 

 

The aim is to obtain a value from a WMS or WFS service and use this value (normally a string) as a filter.

 

My test dashboardMy test dashboard

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @Roboman,

How did you configure the selection interactions? Can you please share some more detail? 

How to Get Your Question Answered Quickly 

In addition, you can also take a look at the following document about selection:

Power BI visual data point selections - Power BI | Microsoft Docs

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.