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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Marty_Mcfly
New Member

Exclude rows from being filtered out of table.

Hello,

 

So I have a business request to make it so the CEO can't be filtered out of table. In the example below I want to be able to select any business org and have the CEO still show up. For example, if I select Business Org 2 or Business Org 3, I still want the CEO to showup. Is this possible in Power Bi?

 

Marty_Mcfly_0-1736322103380.png

 

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@Marty_Mcfly 

you can try to create a new org table to filter

 

Table 2 = DISTINCT('Table'[Business Org])
 
then create a measure
 
Measure = if(max('Table'[Business Org])=SELECTEDVALUE('Table 2'[Business Org])||max('Table'[Job Title])="CEO",1)
 
add this measure to visual filter and set to 1
 
11.PNG
 
if you want to do the multi-selection, you can change the measure to below.
 
Measure =
 VAR list=CONCATENATEx('Table 2','Table 2'[Business Org])
 return if(CONTAINSSTRING(list,max('Table'[Business Org]))||max('Table'[Job Title])="CEO",1)
 
12.PNG
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

danextian
Super User
Super User

Hi @Marty_Mcfly 

 

You can use a disconnected table visually filter your viz. The below calculated table simply returns the distinct category but is not related to any other tables.

 

DisconnectedCategory = 
DISTINCT ( Category[Category] )

 

The CategoryFilter propagates the virtual relationship between the disconnected and connected category table.

 

CategoryFilter = 
VAR _apparel = 
    ROW ( "Category", "Apparel" ) 
-- Creates a single-row table with a column named "Category" and a single value, "Apparel". 
-- This is used later to include "Apparel" explicitly in the filter logic.

RETURN 
    CALCULATE ( 
        COUNTROWS ( Category ), 
        -- Counts the rows in the 'Category' table while applying the filters defined below.

        KEEPFILTERS ( 
            TREATAS ( 
                UNION ( VALUES ( DisconnectedCategory[Category] ), _apparel ), 
                -- Combines the values from the 'DisconnectedCategory[Category]' column 
                -- with the single value "Apparel" from the `_apparel` variable.
                
                Category[Category] 
                -- Maps the resulting values to the 'Category[Category]' column 
                -- in the 'Category' table to apply them as filters.
            )
        )
        -- Ensures that any existing filters on the 'Category[Category]' column 
        -- are preserved while applying the new filters from the TREATAS function.
    )

 

danextian_0-1736324456892.png

Apparel is hidden from the slicer using the visual filter but will always be selected (see CategoryFilter column).

 

Alternatively, you can materialize Apparel for every category row in Power Query

danextian_1-1736324784481.png

But since the table with extra rows won't include unique values anymore and the relationships always flow from one to the many side a single direction relationship, you'll have to make use of a bi-directional relationship.

danextian_3-1736325111356.png

 

The second approach is easier to maintain as you can use the Category2 column to directly filter related tables without the need to create a new measure as a visual filter but this may cause a performance issue on large tables. The difference betwen the two approaches is negligible on small tables.

 

Please see attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Hi @Marty_Mcfly 

 

You can use a disconnected table visually filter your viz. The below calculated table simply returns the distinct category but is not related to any other tables.

 

DisconnectedCategory = 
DISTINCT ( Category[Category] )

 

The CategoryFilter propagates the virtual relationship between the disconnected and connected category table.

 

CategoryFilter = 
VAR _apparel = 
    ROW ( "Category", "Apparel" ) 
-- Creates a single-row table with a column named "Category" and a single value, "Apparel". 
-- This is used later to include "Apparel" explicitly in the filter logic.

RETURN 
    CALCULATE ( 
        COUNTROWS ( Category ), 
        -- Counts the rows in the 'Category' table while applying the filters defined below.

        KEEPFILTERS ( 
            TREATAS ( 
                UNION ( VALUES ( DisconnectedCategory[Category] ), _apparel ), 
                -- Combines the values from the 'DisconnectedCategory[Category]' column 
                -- with the single value "Apparel" from the `_apparel` variable.
                
                Category[Category] 
                -- Maps the resulting values to the 'Category[Category]' column 
                -- in the 'Category' table to apply them as filters.
            )
        )
        -- Ensures that any existing filters on the 'Category[Category]' column 
        -- are preserved while applying the new filters from the TREATAS function.
    )

 

danextian_0-1736324456892.png

Apparel is hidden from the slicer using the visual filter but will always be selected (see CategoryFilter column).

 

Alternatively, you can materialize Apparel for every category row in Power Query

danextian_1-1736324784481.png

But since the table with extra rows won't include unique values anymore and the relationships always flow from one to the many side a single direction relationship, you'll have to make use of a bi-directional relationship.

danextian_3-1736325111356.png

 

The second approach is easier to maintain as you can use the Category2 column to directly filter related tables without the need to create a new measure as a visual filter but this may cause a performance issue on large tables. The difference betwen the two approaches is negligible on small tables.

 

Please see attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
ryan_mayu
Super User
Super User

@Marty_Mcfly 

you can try to create a new org table to filter

 

Table 2 = DISTINCT('Table'[Business Org])
 
then create a measure
 
Measure = if(max('Table'[Business Org])=SELECTEDVALUE('Table 2'[Business Org])||max('Table'[Job Title])="CEO",1)
 
add this measure to visual filter and set to 1
 
11.PNG
 
if you want to do the multi-selection, you can change the measure to below.
 
Measure =
 VAR list=CONCATENATEx('Table 2','Table 2'[Business Org])
 return if(CONTAINSSTRING(list,max('Table'[Business Org]))||max('Table'[Job Title])="CEO",1)
 
12.PNG
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors