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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
sbott
Helper I
Helper I

Filter based on content

Hi, I have a list of data in a column, some of the data contains the letters CE and some contains F&O. 

 

I need a filter with two options, CE or F&O, that when selected, only selects the data which contains either CE or F&O.

 

Just remembered to add the fact that I don't have access to change the source data, so have to use the values supplied for the report.

 

How can I achieve this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

Thanks for the solution @hackcrr  offered, and i want to offer some more information for user to refer to.

hello @sbott , based in your description, you cannot change the datasource, you can craete a measure to filter the data, you can refer to the following solution.

Sample data 

vxinruzhumsft_0-1715838966164.png

Create a measure.

Count = COUNTROWS(FILTER('Table',CONTAINSSTRING([Word],"CE")||CONTAINSSTRING([Word],"F&O")))

Then put the measure to the visual filter.

 

vxinruzhumsft_1-1715839028984.png

 

Output

vxinruzhumsft_2-1715839042241.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi,

Thanks for the solution @hackcrr  offered, and i want to offer some more information for user to refer to.

hello @sbott , based in your description, you cannot change the datasource, you can craete a measure to filter the data, you can refer to the following solution.

Sample data 

vxinruzhumsft_0-1715838966164.png

Create a measure.

Count = COUNTROWS(FILTER('Table',CONTAINSSTRING([Word],"CE")||CONTAINSSTRING([Word],"F&O")))

Then put the measure to the visual filter.

 

vxinruzhumsft_1-1715839028984.png

 

Output

vxinruzhumsft_2-1715839042241.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

sbott
Helper I
Helper I

Hi @hackcrr I am not able to add any columns to the data, I just have access to the all the tables and contents, but not to alter it.

hackcrr
Memorable Member
Memorable Member

Hi, @sbott 

If you need a filter that allows users to select only data containing "CE" or "F&O" from a column without changing the source data, you can accomplish this by creating a calculated column or metric in Power BI. You can do the following.
Create a new calculated column:

FilterFlag = 
IF(
    CONTAINSSTRING([YourColumnName], "CE") || CONTAINSSTRING([YourColumnName], "F&O"),
    "Selected",
    "Not Selected"
)

You can now create slicers based on newly created calculated columns, and users can now select "Selected" or "Unselected" to filter data containing "CE" or "F&O".

 

Best Regards,

hackcrr

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors