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
BI_Analyticz
Helper V
Helper V

Find repeating items in a column and compare with another column to exclude it

Hi Friends,

 

I have a data like below. I want to exclude the rows if the 1st column has similar values but the 2nd column has blank.

 

Example: ABC is in 2 rows but one row has a blank value in the 2nd column. I want to exclude this from dataset. Is this is possible in Power BI?

 

Computer NameDomain
ABCNIS
ABC 
BD11 
DE11MIS
CD11MIS
7 REPLIES 7
rogletree
Helper III
Helper III

If you're just trying to get rid of the blank rows, then in power query the "Remove Rows" gives an option to remove blank rows.

Or do you have some situations where your Computer Name column will have a unique name that has a blank and you want to keep that?

What you are saying is correct. if the computer name is unique but the domain column is blank then keep it. If the computer name is not unique then remove the particular row where the domain value is empty

CNENFRNL
Community Champion
Community Champion

Hi, @BI_Analyticz , what if some records read like this?

Computer NameDomain
XYZ 
XYZ 

You will remove all of them or keep at least one record of its kind?


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

I have to remove XYZ with Domain column as blank..

 

When the computer name appears more than one time in the 1st coumn but in the second column if the domain dns name is blank then I have to exclude it

Anonymous
Not applicable

Hi,

 

If you want to exclude it from your dataset you have to go in Power Query :

- Create a custom column1 to concatenante both columns

- Then create another custom column with condition : if Computer = custom column 1 then "to exclude"

- Then filter your dataset based on the last column created

 

This should work, hope it is clear enough,

If you look at ABC the one of the row has Empty value and I wanna exclude it. But if you look at the next one its unique and domain is also empty. I want to keep that.. 

Hello @BI_Analyticz ,

Create a measure as shown below:

_Domain = 
var _count=CALCULATE(COUNT('Table'[Computer Name]),FILTER(ALL('Table'),'Table'[Computer Name]=MAX('Table'[Computer Name])))
Return
IF(_count>1&&MAX('Table'[Domain])=BLANK(),BLANK(),MAX('Table'[Domain]))

And you'll see:

Screenshot 2020-10-14 151843.png

For the related .pbix file, see attachment pls.

Saludos
Kelly

Have I answered your question? Mark my position as a solution!

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.