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
rkouwenhoven
Frequent Visitor

Use filter to exclude

I'm having a problem to exclude rows based on a slicer. I've read other topics but none of them solves the issue.

I want to exclude rows in an order table based on Client_id. I have a seperate table with "Client views". In these specific views you can exclude the Client_id or show the client_id. See example below. 

When using a slicer and select for example view_id 1, it shows all the orders with clients A and B. 

 

When selecting view_id 3 in the slicer I want to see all orders except for clients B and E. Anybody able to assist?

Knipsel.PNG

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

hi @rkouwenhoven ,

 

Please check following steps as below:

1. Create Measure =

               var s_h = MAX(Table1[show_hide])

               return

               IF(s_h = "1" &&

                   MAX(Table2[client_name]) in VALUES(Table1[client_name]),

                   1,

                   IF(s_h = "0"&&

                       NOT(MAX(Table2[client_name])) in VALUES(Table1[client_name]),

                       1,

                       BLANK()))

2. Filters on visual measure is not blank.

Capture.PNG

 

Results would be shown as below:

Capture1.PNGCapture2.PNG

BTW, PBIX file as attached, hopefully works for you.

Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

hi @rkouwenhoven ,

 

Please check following steps as below:

1. Create Measure =

               var s_h = MAX(Table1[show_hide])

               return

               IF(s_h = "1" &&

                   MAX(Table2[client_name]) in VALUES(Table1[client_name]),

                   1,

                   IF(s_h = "0"&&

                       NOT(MAX(Table2[client_name])) in VALUES(Table1[client_name]),

                       1,

                       BLANK()))

2. Filters on visual measure is not blank.

Capture.PNG

 

Results would be shown as below:

Capture1.PNGCapture2.PNG

BTW, PBIX file as attached, hopefully works for you.

Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

@v-jayw-msft ,

I can't seem to get this reproduced. I followed your steps but the measure is not allowed as a filter, neither as a value in the visual. it gives me a failure message. Do I need to have a specific relationship between the 2 tables?

@v-jayw-msft ,

After some testing it is doing the magic. The 0 and 1 were set up as a whole number in the table but had to change it to a text field. No relation in tables, so now it is working.

 

Thanks a lot for your help. 

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.