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

Filter Out Same-Value Data in One Column, When a Value in Another Column Is Not Present

Hello,

I don't even know what words to use to call, or describe what I need to do, let alone search for a solution appropriately, so I am trying to explain it as clearly and simplistically as possible.

 

I have law enforcement call data, which in its simplest form is made up of the "Call Number", "Deputy Name," and their "Unit Role." I need to keep, and analyze all the deputies that were assigned to the same calls as one specific deputy (Casey, in my example). I need to do this by filtering out all the calls that Casey was NOT assigned to. However, if I just use a filter to filter for Casey's calls, I will filter out all the other deputies that were assigned to the same calls Casey was assigned too, and those are the rows of data that I actually need for this analysis.

 

I am trying to answer the questions, "Which deputies were assigned as "Primary" to the calls Casey was also assigned to, and how many times?"

 

How can I isolate my data so I am just working with the call numbers and all their rows, that Casey was assigned to so I can further analyze what other deputies were assigned to those calls and their roles??

 

Here is a screenshot of the sample data to illustrate what I have, and what I am trying to do with it. Any help would be so greatly appreciated! Thank you!

 

Ashley

 

ClackamasAshley_0-1703001535839.png

 

Call NumberDeputy NameDeputy RoleWhat to Do with Each Call Number
3476890CaseyPrimaryKeep
3476890JoeAdditional
3476890MeganAdditional
3476890TimAdditional
3476891MeganPrimaryFilter Out
3476891RenaeAdditional
3476892CaseyPrimaryKeep
3476892AdamAdditional
3476892JoeAdditional
3476892MeganAdditional
3476892RenaeAdditional
3476893RenaePrimaryKeep
3476893CaseyAdditional
3476894TimPrimaryFilter Out
3476894AdamAdditional
3476894JoeAdditional
3476895JoePrimaryKeep
3476895AdamAdditional
3476895CaseyAdditional
3476895RenaeAdditional
3476895TimAdditional
3476896RenaePrimaryFilter Out
3476896AdamAdditional
3476896MeganAdditional
3476897JoePrimaryFilter Out
3476897RenaeAdditional
3476897TimAdditional
3476898JoePrimaryKeep
3476898CaseyAdditional
1 REPLY 1
tzvetkov_b87
Helper I
Helper I

Hi @ClackamasAshley ,

 

I create a Power BI file and uploaded it here for you to have a look.

 

The way I have done it is:

I am assuming it will not always be Casey you want to select so it is dynamic.

 

I created a new table called 'Deputies'. This doesn't have an Active relationship, because we don't want it to filter the Callouts.

 

I've added a slicer from the 'Deputies' table to allow us to select just one Deputy.

 

We then create a measure that does the following:

1. see who is the selected deputy

2. get the current case number (as this measure will be displayed on a table, each row will have its own case number)

3. create table with all the distinct case numbers that the selected deputy has worked on

4. check if the current case number is in the table of all cases that the deputy has worked on.

 

Hope this helps out - and if anybody has a quicker or better way of doing it let me know. 

 

If I helped, please mark my post as the answer and a kudos will be very much appreciated 🙂

 

Merry Christmas and a Happy New Year !

 

Boyan

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.