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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
MStaford
Regular Visitor

Case insensitive table.findtext across multiple columns

Hi All,

I have a situation where I have to bring across only those rows where a specific values specific value (lets say, "true")  appears in 5 selected columns with multiple files with each including over 200 to 400K rows.

 

Minimum rules - The "true" can be atleast in one column to qaulify the extraction of row.

 

Additionally, the text in the column inconsistent with some files has it uppercase and other have it in lowercase.

 

Following is the dummy dataset.

 

idbla1yaba2daba3lamadoo
1222truetruetruetruetrue
1233TRUETRUETRUETRUETRUE
1234TrueTrueTrueTrueTrue
1443TrueFalseTrueFalseFalse

 

I have tried the following formula to extract the rows however, it only extract rows where a lowercase or uppercase depending on the text case i have used in the argument.

 

table.IsEmpty(table.FindText(table.SelectionColumns([dataset],{"bla1", "yaba2","daba3","lama","doo"}),"true")) (or using "TRUE" OR "True")

 

Problem statement - is there anyway we can modify this formula to check for "true" ignoring the case? or is there anyother options i can use?

 

Additionally, I have tried to do data normalisation and a conditional column to allocate numeric marker (1,2,3,4,5) for each column if there is "true" values (0 for false) and filter the column with false value to condence the result . It works however, I have to load the data in power query and then normalise the data to upper or lowercase which is not favourable as combine total rows of these files can go over 20mil.

 

I feel i might be sailing close to the answer but unable to get my hands on it.

 

I hope someone can help me.

 

Thankyou in advance for your help and support 😊

 

1 ACCEPTED SOLUTION

Hi @MStaford 

 

Still using the same code  in my initital post but changing List.AllTrue to List.AnyTrue to check if at least one of the column values contains the word true..

let
    // Step 1: Define a list of values, replace with the actual column names
    ColumnsAsAList = {[bla1], [yaba2], [daba3], [lama], [doo]},

    // Step 2: Convert each value in the list to a logical (true/false)
     ChangedType = List.Transform(ColumnsAsAList, Logical.From),
    // Step 3: Check if all values in the list are true. Use List.AnyTrue to return true if any of the values in the list  is true
    TrueOnly = List.AnyTrue(ChangedType)
in  
   TrueOnly




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

5 REPLIES 5
MStaford
Regular Visitor

Hi @danextian and@ryan_mayu,

 

Thankyou for your reply and suggested solutions. The minimum condition for true value to be the result is that atlease one col should have a true value and only if all appears false then the result should be false. Apologies if i was not clear in my notes above. Here is a quick sample..

Col1Col2col3col4col5Result
truetruetruetruetruetrue
truefalsetruefalsetruetrue
truefalsefalsefalsefalsetrue
falsefalsefalsefalsefalsefalse

 

@AnonymousI have not tried your method but will give it a go and come back.

 

 

Hi @MStaford 

 

Still using the same code  in my initital post but changing List.AllTrue to List.AnyTrue to check if at least one of the column values contains the word true..

let
    // Step 1: Define a list of values, replace with the actual column names
    ColumnsAsAList = {[bla1], [yaba2], [daba3], [lama], [doo]},

    // Step 2: Convert each value in the list to a logical (true/false)
     ChangedType = List.Transform(ColumnsAsAList, Logical.From),
    // Step 3: Check if all values in the list are true. Use List.AnyTrue to return true if any of the values in the list  is true
    TrueOnly = List.AnyTrue(ChangedType)
in  
   TrueOnly




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Hi ,

The method ryan_mayu provided should be helpful.

Besides, you can also try the following formula to add the custom column.

if Text.Contains([bla1], "true", Comparer.OrdinalIgnoreCase) or
   Text.Contains([yaba2], "true", Comparer.OrdinalIgnoreCase) or
   Text.Contains([daba3], "true", Comparer.OrdinalIgnoreCase) or
   Text.Contains([lama], "true", Comparer.OrdinalIgnoreCase) or
   Text.Contains([doo], "true", Comparer.OrdinalIgnoreCase)
then "true" else "false"

 

Best Regards,

Wisdom Wu

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

danextian
Super User
Super User

Hi @ryan_mayu 

 

Try this custom  column in the query editor. Use List.AnyTrue to return true if any of the values in the list  is true

let
    // Step 1: Define a list of values
    ColumnsAsAList = {[bla1], [yaba2], [daba3], [lama], [doo]},

    // Step 2: Convert each value in the list to a logical (true/false)
     ChangedType = List.Transform(ColumnsAsAList, Logical.From),
    // Step 3: Check if all values in the list are true. Use List.AnyTrue to return true if any of the values in the list  is true
    TrueOnly = List.AllTrue(ChangedType)
in  
   TrueOnly

danextian_0-1737020766781.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
ryan_mayu
Super User
Super User

@MStaford 

you can try this to create a new column to check.

 

= Table.AddColumn(Source, "Custom", each
[a=List.Skip(Record.ToList(_)),
b=List.RemoveItems(List.Transform(a, each Text.Lower(_)),{"true"}),
c=if List.Count(b) = 0 then true else false]
[c]
)

11.PNG

 

pls see the attachment below

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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