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

Help with partially canceling filters.

HI all,
I am working with the Map visual in order to show which aircraft routes fly over restricted areas.  I am using a colume named TYPE to determing the color of the flight path or the area.  This column has values of TRACK, and AREA. These areas use the same columns of LAT, LONG, SEQUENCE, and ID# as the flight paths, but when shown on the map show as polygons rather than lines.  There is also a column named RUTA, which details the origin and destination of the flight paths.  The cells of this column that are associated to the areas just show the code name of the area.  Here is a screenshot of the table for more clatity.

AlanRGroskreutz_0-1624952623102.png

 

What I want to do, but can't seem to find a way to accomplish it is when filtering for RUTA, to not only show those flight paths that correspond with the selected filter, but to always show the areas. In other words, that the filter would include the selected TRACK rows based upon the value in RUTA, but not filter out the AREA rows.

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @AlanRGroskreutz,

You need to use an unconnected table as the source of the slicer then write a measure expression to compare current table records and selections to return tags to achieve custom filter effects.
After these steps, you can use this on 'visual level filter' to filter not-matched records.

Applying a measure filter in Power BI - SQLBI

If you confused about the coding formula, share some dummy data with the raw table structure and expected results to test.

How to Get Your Question Answered Quickly
Regards,

Xiaoxin Sheng

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

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @AlanRGroskreutz,

You need to use an unconnected table as the source of the slicer then write a measure expression to compare current table records and selections to return tags to achieve custom filter effects.
After these steps, you can use this on 'visual level filter' to filter not-matched records.

Applying a measure filter in Power BI - SQLBI

If you confused about the coding formula, share some dummy data with the raw table structure and expected results to test.

How to Get Your Question Answered Quickly
Regards,

Xiaoxin Sheng

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

View solution in original post

OK, I think I responded a bit too soon. The measure I wrote works great when one route is selected, but when more than one is selected I get the error that I am getting more than one vaslue where one was expected.

Here is the measure I wrote:

 

Route_Filter = 
    CALCULATE (
        VALUES ( 'Mapa Ortos-Trazas-Areas'[ID#] ),
        FILTER (
            'Mapa Ortos-Trazas-Areas',
            'Mapa Ortos-Trazas-Areas'[Ruta] = VALUES ( Ruta[Ruta] )
                || 'Mapa Ortos-Trazas-Areas'[type] = "AREA"
        )
    )

 

I have the measure as one of the visual filters like you said and it is set to "not blank". Not sure that would make a difference.

After fighting with the code of the measure for a few days I got it to work. Thanks.

 

Thanks, I'll get back to you if I have any questions.

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Top Solution Authors
Top Kudoed Authors