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
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

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


View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

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


@ 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!:
The Definitive Guide to Power Query (M)

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.

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


@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=

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


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
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.