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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
selpaqm
Helper V
Helper V

Containstring takes ages

Hi,

 

i have a calculated column contains containstring. it works however each refresh take hours with more than 1000 rows. normally my table has more than 400k rows. so is there any way to speed it up with changing another think.

 

if (Countx (filter (Table2, CONTAINSSTRING (Table2 [ID], Table1 [ID])), Table2 [ID])> 0, "Yes", "No")

also you may find entire example on below link 

 

example 

1 ACCEPTED SOLUTION
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @selpaqm ,

 

I once created a Power Query prototype here. The merging between the two tables can possibly still be optimized.

See attachement.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


View solution in original post

6 REPLIES 6
Greg_Deckler
Community Champion
Community Champion

@selpaqm - Perhaps try SEARCH or FIND instead of CONTAINSSTRING?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  thanks for your suggestion. when i try to use search, I have get "The search Text provided to function 'SEARCH' could not be found in the given text." error.

"minx(filter(table,search(" does not fit.

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @selpaqm ,

 

I once created a Power Query prototype here. The merging between the two tables can possibly still be optimized.

See attachement.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


@mwegener thanks for your work. I think I have trouble on added custom1 (true false contain section) it gives below error.

 

Expression.Error: We cannot apply operator & to types Number and Text. Details: Operator=& Left=2030691335 Right=
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @selpaqm ,

 

you are trying to combine a text with a number. Both values must first be converted to the data type text.

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Hi @mwegener ,

 

thanks for the solution, I realized and fixed it. waiting to calculation ending, seems all contain column as "FALSE". after calculation hope it will be ok.

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors