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

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

Reply
WonderCoding
Frequent Visitor

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 3
tctrout
Responsive Resident
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.

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

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.

Helpful resources

Announcements
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 Kudoed Authors