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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Yumti
Frequent Visitor

Searching for specific text in a text colum

Hello

 

In my report I'm trying to create a column in a table that would show true or false after searching for specific text in another column containing text. 

For example: A cell in column A contains the text "Ecodesign requirements – amendment of EU rules on fans driven by motors between 125 watts and 500 kilowatts". I want the new column B to return "True" if the text contains "eu".

 

I've tried looking at the containsstring function, which would seem to do the trick, but that only applies to measures and calculated columns. Is there any way to achieve this with another function or can you convert column A to a calculated column still containing the origial text, so I could apply the containstring function?

 

Thanks!

1 ACCEPTED SOLUTION

I gave up trying to get it to work with direct query and went back to excel.

 

I appreciate the help, but I'm unable to share my pbix as it also contains a lot of more sensitive data and cleaning it would be too much of a time drain.

View solution in original post

11 REPLIES 11
Anonymous
Not applicable

Hi @Yumti ,

Any update o this? Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi @Yumti ,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

I gave up trying to get it to work with direct query and went back to excel.

 

I appreciate the help, but I'm unable to share my pbix as it also contains a lot of more sensitive data and cleaning it would be too much of a time drain.

Anonymous
Not applicable

HI @Yumti,

OK, hopes you can find some better workarounds to achieve your requirements on excel side.
Regards,

Xiaoxin Sheng

Yumti
Frequent Visitor

Thanks for the fast reply. 

 

I've tried that but I can't select the specific column in the table, that I want. The formula only lets me select some measures I made previously.

 

@Yumti , Go to modelling tab and create new calculated column and if you still face any issue share sample data




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






I think I might know what the problem is.

 

I just tried downloading the data set to excel and importing in from there. Then I can add the calculated column with no issues.

 

The report I'm working on is getting the data from a semantic model in the OneLake-datahub and that seems to cause some issues. For one the Table View disappears entirely from my Power BI Desktop front, when importing a semantic model.

 

Is there any way to solve my issue when using data from a semantic model?

@Yumti , Either try changing your data source or create a new measure 

 

Contains EU Measure =
IF(
MAXX(
FILTER(
TableName,
CONTAINSSTRING([Column A], "eu")
),
1
) = 1,
TRUE,
FALSE
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






That measure can connect to the right column, but I get an expression error when trying to add it as a column to my table.

 

If I can't get this to work with my direct query data and have to download the data to excel before importing, then I might as well just do the whole thing in excel.

 

Thank you for trying though. 

hello @Yumti 

 

are you looking like this?

Irwan_0-1737240339990.png

[Column B] is in form of measure. IF statement in measure [Column B] will looking for "EU" string (not case sensitive) in 'Column A' then return "True" if there is a matched value.

You can see measure value in Table Visual (not in form of column like calculated column) since measure works with filter.

 

also if you are using Direct Query, you most likely will not see the Table View therefor you can not add calculated column in Direct Query table.

Irwan_1-1737240480989.png

Irwan_3-1737240922410.png

Again, you most likely will use measure in Direct Query.

 

Hope this will help.

Thank you.

bhanu_gautam
Super User
Super User

@Yumti , Create a new calcuated column like

 

Column B = IF(CONTAINSSTRING([Column A], "eu"), TRUE, FALSE)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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