Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

DirectQuery can't fold expression in Databricks

Hello,

 

I am using the Databricks connector to PowerBI in DirectQuery mode and I have a rather simple expression to get some text in the middle of a string.

Measure:

Q =
var ids=FIND(raw_msg[raw_message],"<Q>",1,0)+3
return MID(raw_msg[raw_message],ids,2)
 
This returns an error saying "We couldn't fold the expression to the data source. Please try a simpler expression."
Any other solution to this? 
 
Thanks in advance!

3 Replies

  • tctrout's avatar
    tctrout
    Responsive Resident

    DAX is more limited when connected Direct Query in general.  Additionally, DirectQuery on Databricks  is more limited than Direct Query SQL Server.  The reason being is that DirectQuery on Databricks leverages Apache SQL where Direct Query on SQL Server uses TSQL.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the explanation. So I assume that the solution is to change it in the source.

      • tctrout's avatar
        tctrout
        Responsive Resident

        Thats where I would start: Roche's Maxim of Data Transformation:
        "Data should be transformed as far upstream as possible, and as far downstream as necessary"

        If for some reason you cant, I would investigate doing it in MCode instead and as a last resort investigate Apache Spark syntax and see if there is an alternative.