cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
herbemischung Regular Visitor
Regular Visitor

count if column

Hi,

 

I think there has to be an easy solution to my problem. 

 

I have a column where almost every value appears two times with a few exeptions:

 

ID_A

ID_A

ID_B

ID_B

ID_C

ID_C

ID_D

ID_E

ID_E...and so on

 

 

In this example i want to get rid of ID_D. To do so I wanted to create a new column in the Query Editor that works like a Count IF Formula in Excel so that I can filter out all ID's with just one entry. 

 

But I'm stuck here somehow 😞

 

Screenshot

1 ACCEPTED SOLUTION

Accepted Solutions
MarkS Member
Member

Re: count if column

Hi @herbemischung,

In the Query Editor you should be able to Group BY Your ID Column, the default is a column with the count of the rows, and then also add the All Rows as the second aggregation column.

 

 

Community04-03-2018.PNG

Then filter the Count column to those that are not one.

Remove the Count Column

Expand the Column that contains tables (the All Rows column)

View solution in original post

3 REPLIES 3
Super User
Super User

Re: count if column

If you really want a column and not a measure, then you can do it by doing something along the lines of:

 

Column = CALCULATE(COUNT(Table[ID]),FILTER(ALL(Table),Table[ID]=EARLIER(Table[ID])))

 

 


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

MarkS Member
Member

Re: count if column

Hi @herbemischung,

In the Query Editor you should be able to Group BY Your ID Column, the default is a column with the count of the rows, and then also add the All Rows as the second aggregation column.

 

 

Community04-03-2018.PNG

Then filter the Count column to those that are not one.

Remove the Count Column

Expand the Column that contains tables (the All Rows column)

View solution in original post

herbemischung Regular Visitor
Regular Visitor

Re: count if column

Thank you, this really did the job 🙂

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 6 members 2,237 guests
Please welcome our newest community members: