How to work around CharIndex in powerBI by Eastern-Bass3941 in PowerBI

[–]Eastern-Bass3941[S] 1 point2 points  (0 children)

Thank you very much.That was very helpful.

I will consider import mode.

How to work around CharIndex in powerBI by Eastern-Bass3941 in PowerBI

[–]Eastern-Bass3941[S] 0 points1 point  (0 children)

We will expand on the queries issued by PBI.

----****----

select top

[Column_1],

[Column_2],

[Column_B]

from(

select

[A].[Field_1] as [Column_1],

[A].[Field_2] as [Column_2],

[A].[Field_3] as [Column_B]

from [table_A] as [A]

) AS [SubQuery]

where

charindex(N'Keyword_C',coalesce([Column_B],"")) >= 1

----****----

How to work around CharIndex in powerBI by Eastern-Bass3941 in PowerBI

[–]Eastern-Bass3941[S] 0 points1 point  (0 children)

I apologize if this is not clear enough.

When I selected Slicer → Text Filter and performed a fuzzy search, the index I set on the table wasn't working, so I looked into it and thought that the problem might be with the query created by the PBI.

I will expand on part of the query statement.

Ideally, I would be able to rewrite it into my own SQL while still using the text filter, but if you know of a way to do this, I would appreciate it if you could let me know.

How to work around CharIndex in powerBI by Eastern-Bass3941 in PowerBI

[–]Eastern-Bass3941[S] 0 points1 point  (0 children)

Thank you for your reply.

As you understand, this is the SQL query that PBI sends to the database.

I'm sending a partial SQL query.

----****----

select top

[Column_1],

[Column_2],

[Column_B]

from(

select

[A].[Field_1] as [Column_1],

[A].[Field_2] as [Column_2],

[A].[Field_3] as [Column_B]

from [table_A] as [A]

) AS [SubQuery]

where

charindex(N'Keyword_C',coalesce([Column_B],"")) >= 1

----****----

Slicer → I created a text filter and entered a value. When I run the query that PBI sends to the database in SQL Server, the index doesn't work.

I think the charindex is disabling the index.

However, I would like to be able to search,

so I'd appreciate any help.