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
Anonymous
Not applicable

Include Exclude option in Power BI matrix visual

Hi Is ther any way to hide the option for Include/exclude option on matrix visual whe we do a right click on row?

 

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

Hi @Anonymous,

You can create a measure with unrelated table fields filters and extract selected values to compare with current row contents to return tag.  After these steps, you can use this measure on 'visual level filter' as a filter to achieve include or exclude effect filter effect.

Applying a measure filter in Power BI 

Calculate Table:

 

Selector=Values(Table[Column])

 

Measures:

 

measure filter (Include) =
VAR selected =
    ALLSELECTED ( Selector[Column] )
RETURN
    IF ( SELECTEDVALUE ( Table[Column] ) IN selected, "Y", "N" )

measure filter (Exclude) =
VAR selected =
    ALLSELECTED ( Selector[Column] )
RETURN
    IF ( SELECTEDVALUE ( Table[Column] ) IN selected, "N", "Y" )

 

Notice: if you do not want to add an additional table as the source of measure filter, you can consider defining variables into the measure and compare that variable with current row contents.

Static measure filter (Include) =
VAR selected = {"A","B","C","D"}
RETURN
    IF ( SELECTEDVALUE ( Table[Column] ) IN selected, "Y", "N" )

Static measure filter (Exclude) =
VAR selected = {"A","B","C","D"}
RETURN
    IF ( SELECTEDVALUE ( Table[Column] ) IN selected, "N", "Y" )

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
WendyDUFE
Helper III
Helper III

@Anonymous  Hi Shilpi, 

 

Have you tried the solution? does it work ? 

 

Thank you

v-shex-msft
Community Support
Community Support

Hi @Anonymous,

You can create a measure with unrelated table fields filters and extract selected values to compare with current row contents to return tag.  After these steps, you can use this measure on 'visual level filter' as a filter to achieve include or exclude effect filter effect.

Applying a measure filter in Power BI 

Calculate Table:

 

Selector=Values(Table[Column])

 

Measures:

 

measure filter (Include) =
VAR selected =
    ALLSELECTED ( Selector[Column] )
RETURN
    IF ( SELECTEDVALUE ( Table[Column] ) IN selected, "Y", "N" )

measure filter (Exclude) =
VAR selected =
    ALLSELECTED ( Selector[Column] )
RETURN
    IF ( SELECTEDVALUE ( Table[Column] ) IN selected, "N", "Y" )

 

Notice: if you do not want to add an additional table as the source of measure filter, you can consider defining variables into the measure and compare that variable with current row contents.

Static measure filter (Include) =
VAR selected = {"A","B","C","D"}
RETURN
    IF ( SELECTEDVALUE ( Table[Column] ) IN selected, "Y", "N" )

Static measure filter (Exclude) =
VAR selected = {"A","B","C","D"}
RETURN
    IF ( SELECTEDVALUE ( Table[Column] ) IN selected, "N", "Y" )

Regards,

Xiaoxin Sheng

 

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

It seems like the default option.  What is the need?

 

@amitchandak  HI Amitchandak, 

 

I have the same needs as well. For my case, when publishing the pbix file, I set the filter pane as hide. So when user browse the report from web side, after they select include or exclude, they can not cancel it, which brought a lot of confusion. 

 

This is a cool feature, but it is prefered to be optional, not default.  

 

Any idea ? 

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.