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
Anonymous
Not applicable

finding if a value appears at least once in a column filtered by another column

I need help finding if a value appears at least once in a column filtered by another column.

Following the simplified Table, I need to check if the ID has been registered at least once for the class.

 

IDClassRegistered to Class 1111?
AAAA1111Yes
BBBB2222No
BBBB3333No
BBBB4444No
CCCC1111Yes
CCCC4444Yes
DDDD3333No
EEEE1111

Yes

EEEE2222

Yes

 

My school of thought was to filter each ID and check wheter or not one of the class where the specified class, a but ended up getting nowhere. I can do it if I create a new table, but I need it to bein a column of the same table.

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please check the below for creating a new column.

 

Picture2.png

 

Registered to Class 1111? =
VAR currentid = 'Table'[ID]
VAR alltablefilteredbycurrentid =
SUMMARIZE ( FILTER ( 'Table', 'Table'[ID] = currentid ), 'Table'[Class] )
RETURN
IF ( { 1111 } IN alltablefilteredbycurrentid, "Yes", "No" )
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
fhill
Resident Rockstar
Resident Rockstar

How's this custom column?

VAR an Array of 'Good' IDs where Class = 1111   (Or whatever you are seraching for...)

Then if current row's ID is 'Contained' in the Array, YES, else NO

 

fhill_0-1619717021990.png

 

 




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please check the below for creating a new column.

 

Picture2.png

 

Registered to Class 1111? =
VAR currentid = 'Table'[ID]
VAR alltablefilteredbycurrentid =
SUMMARIZE ( FILTER ( 'Table', 'Table'[ID] = currentid ), 'Table'[Class] )
RETURN
IF ( { 1111 } IN alltablefilteredbycurrentid, "Yes", "No" )
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.