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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hey,
I'm getting the following error when using a variable and logical operator in a column (using direct query).
"An unexpected error occurred (file 'tmmdmodeltm.cpp', line 5980, function 'MDModelTM::GenBaseTableQuery')."
DAX formula
createdChanged = var x = DATEDIFF(xxxxxx[createdDate];xxxxxx[changedDate];DAY) return if(x>1000;0;x)
This formula works fine in Import mode. Tried several scenarios, but it seems the error is thrown when the variable is used as part of the logical test (e.g. this works: createdChanged = var x = DATEDIFF(xxxxxx[createdDate];xxxxxx[changedDate];DAY) return if(1=1;x;1)
Any thoughts?
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.