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
UsePowerBI
Post Prodigy
Post Prodigy

How to check if a value is contained in a filtered column?

Hello

 

I want to check if a value is present or not in a filtered column.

 

How can I do that?

 

I know the function CONTAINS and I was thinking to use it with the function FILTER but the FILTER function returns a table and not a particular column.

 

Thanks!

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @UsePowerBI ,

 

You could use CALCULATETABLE() to get filtered column2.

Column =
VAR a =
    CALCULATETABLE (
        DISTINCT ( 'Table'[Column2] ),
        FILTER ( 'Table', 'Table'[Column3] = BLANK () )
    )
RETURN
    'Table'[Column1] IN a

Here is the result.

3-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

3 REPLIES 3
v-eachen-msft
Community Support
Community Support

Hi @UsePowerBI ,

 

You could use CALCULATETABLE() to get filtered column2.

Column =
VAR a =
    CALCULATETABLE (
        DISTINCT ( 'Table'[Column2] ),
        FILTER ( 'Table', 'Table'[Column3] = BLANK () )
    )
RETURN
    'Table'[Column1] IN a

Here is the result.

3-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
amitchandak
Super User
Super User

@UsePowerBI ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

@amitchandak 

 

I have a table with several columns.

 

I want to check if the value in Col1 exists in a list of values that is comprised of Col2 filtered by some conditions (e.g. when Col3=blank).

 

Hope this helps.

 

Thanks!

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.