Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
herbemischung
Resolver I
Resolver I

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
MarkS
Resolver IV
Resolver IV

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
MarkS
Resolver IV
Resolver IV

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)

Thank you, this really did the job 🙂

Greg_Deckler
Super User
Super User

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])))

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.