Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

CONTAINSSTRING in EVALUATE error

Hey guys.

 

I'm trying to pull data from SSAS in Import mode using DAX Query. But having trouble with CONTAINSSTRING in EVALUATE statement. No matter how I change it, it gives me error every time.

EVALUATE
FILTER(
    ALL( 'Task'[appointment_type] ),
    CONTAINSSTRING( [appointment_type], "Callcenter" )
)
 
The error I get is following:
DataSource.Error: AnalysisServices: Query (4, 5) Failed to resolve name 'CONTAINSSTRING'. It is not a valid table, variable, or function name.
Any ideas?
 
IN operator also doesn't seem to work in EVALUATE statement.
 
  • BeaBF's avatar
    BeaBF
    2 years ago

    Anonymous  DAX queries in Analysis Services mainly incorporate a limited set of DAX functions, and not all the functions found in Power BI or Power Pivot are accessible within DAX queries.

    The capabilities provided in DAX queries are influenced by the version and compatibility level configured for your Analysis Services instance.

6 Replies

  • Anonymous  Hi! Try with:

    EVALUATE
    FILTER(
    ALL( 'Task'[appointment_type] ),
    CONTAINSSTRINGEXACT( 'Task'[appointment_type], "Callcenter" )
    )

    BBF

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thx for your reply.

      I don't see how a very similar function would make a difference. Anyway, it doesn't work.

      • BeaBF's avatar
        BeaBF
        Super User

        Anonymous you're right. Have you tried with the SEARCH?
        EVALUATE
        FILTER(
        ALL( 'Task'[appointment_type] ),
        SEARCH("Callcenter", 'Task'[appointment_type], 1, 0) > 0
        )

        BBF