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