Thursday, May 16, 2013

DAX Literal Date Syntax changed with Compatibility Mode 11.0.3

Just a quick post here about a situation that came up with literal dates in DAX when a client downloaded one of my DAX for T-SQL folks scripts and found that it didn't work. The statement is this:


evaluate (

FILTER('Date','Date'[Full Date] = "2013-04-01")

)


You receive an error stating a data type mismatch and the above doesn't run.

The problem is with the compatibility mode your BISM Tabular model is in.  In 11.0.0 the above syntax works fine but with 11.0.3 you get the mismatch error.

The statement above needs to use the FORMAT function with 11.0.3 as below:


evaluate (

FILTER('Date', FORMAT('Date'[Full Date],"YYYY-MM-DD") = "2013-04-01")

)


Hope this helps and included the actual code below to download.

No comments:

Post a Comment