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! Learn more

Reply
graphIt
Frequent Visitor

Filter visual to NOT show selected value

Hello Friends,

 

I have an interesting scenario as a result of COVID-19 I'm trying to see if I can track people that may have come in contact with each other on a bus. The basic setup is a drop down slicer with a list of IDs and a table visual that shows the IDs and bus # for a date range.

 

The trick that I'm not sure how to do is to filter the visual for what was NOT selected in the slicer. for example

 

ID    Bus  Day

1      1      1

2      1      1

3      1      1

1      2      2

4      2      2

5      2      2

 

so lets say in my slicer I select ID 1

 

The table should then show the following IDs

 

ID

2

3

4

5

 

If ID 2 was selected in the slicer then I would see

 

ID

1

3

 

Any ideas on how to make this work?

 

thank you for your help and suggestions.

1 ACCEPTED SOLUTION

@graphIt that is an easy fix, I was not sure if you want to selected id or not.

 

Measure = 
VAR __selectedId = SELECTEDVALUE ( Slicer[Id] )
VAR __buses = CALCULATETABLE ( VALUES ( Data[Bus] ), Data[Id] = __selectedId )
RETURN
CALCULATE ( COUNT ( Data[Id] ), __buses, KEEPFILTERS ( Data[Id] <> __selectedId ) )

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

@graphIt you should create a separate ID table for slicer which doesn't have relationship with your main table and from there it should be super easy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@graphIt solution attached.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thank you @parry2k 

 

the sample you provided doesn't quite solve issue, but it does give me some ideas to try.

It is close though. The idea is, with the sample you provided, if ID 2 was selected in the slicer then it should not show in table visual.

 

I'll play around with this some more. Thanks for the suggestion.

@graphIt that is an easy fix, I was not sure if you want to selected id or not.

 

Measure = 
VAR __selectedId = SELECTEDVALUE ( Slicer[Id] )
VAR __buses = CALCULATETABLE ( VALUES ( Data[Bus] ), Data[Id] = __selectedId )
RETURN
CALCULATE ( COUNT ( Data[Id] ), __buses, KEEPFILTERS ( Data[Id] <> __selectedId ) )

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thank you @parry2k  I did not notice the measure in the visual filter.

 

Thanks for your help. You, my fried, are a mother #$%%@& rock star!

😂



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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