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
AlanRGroskreutz
Helper II
Helper II

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.

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
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.