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

How to remove rows where a column contains a value that's not present in another column in any rows?

I have two columns in a table with two columns Person and Manager as below.

 

PersonManager
00010003
00020003
0003 
00040005

 

I want to remove the last row, i.e the one with Person = 0004 and Manager = 0005 as 0005 is not present in the person column for any of the rows. 

 

The end result I want would thus be: 

 

PersonManager
00010003
00020003
0003 



How do I do this in Power BI? 

1 ACCEPTED SOLUTION
kumarthombre20
Resolver I
Resolver I

@pythongtdax Can you try this 

kumarthombre20_0-1648536939131.png

 

Unique List Flag = 
CONTAINS(tblPerson,tblPerson[Person],tblPerson[Manager]) || CONTAINS(tblPerson,tblPerson[Manager],tblPerson[Person])

View solution in original post

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @pythongtdax ,

 

Here's the sample data I created.

vstephenmsft_0-1648793839670.png

 

First create a calculated column using LOOKUPVALUE function.

 

Column = IF(ISBLANK(LOOKUPVALUE('Table'[Person],'Table'[Person],'Table'[Manager]))&&NOT(ISBLANK([Manager])),"N","Y")

 

vstephenmsft_5-1648794265902.png

 

Then you can add the column into the slicer for filtering.

vstephenmsft_7-1648794285924.png

 

Or add to visual-level filters.

vstephenmsft_6-1648794276459.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

kumarthombre20
Resolver I
Resolver I

@pythongtdax Can you try this 

kumarthombre20_0-1648536939131.png

 

Unique List Flag = 
CONTAINS(tblPerson,tblPerson[Person],tblPerson[Manager]) || CONTAINS(tblPerson,tblPerson[Manager],tblPerson[Person])
Samarth_18
Community Champion
Community Champion

Hi @pythongtdax ,

 

If I took your question correctly then I think you can use filter on visual like below or you can remove it from PQ.

 

 

Samarth_18_0-1648535319137.png

 

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

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.