Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi community,
I was wondering if anyone has come across an issue using the DATEDIFF function against a SQL database in DirectQuery mode when trying to create a calculated column? Or if I am doing something just plain wrong.
I've been using DATEDIFF just fine in Import mode against Excel spreadsheets and the data is in the same format. I'm now working on converting a flat Excel report into a live SQL connection, but I'm get a nice error stating:
The following exception occurred while the managed IDbCommand interface was being used: 'DATEDIFF_BIG' is not a recognized built-in function name.
I was wondering if anyone had seen this before and if it was expected behaviour in DirectQuery. Usually the desktop app is quite clever about warning about things which won't work, but this wasn't one of them. I have also tried turning off 'allow unrestricted measures' but that hasn't worked either.
Cheers,
Rob
Solved! Go to Solution.
Base on my understanding, that is a potential bug or an intentional design(maybe only the compability with Azure SQL products is considered, as they are hot and cloud).
In the DirectQuery mode connecting to a SQL Server source, the calcuated column in DAX is "translated" to Transact-SQL(T-SQL, SQL Server query and programing language). Database engine runs the translated T-SQL and returns the query result ideally.
In this case, DATEDIFF in DAX is most probably translated to DATEDIFF_BIG in T-SQL, however DATEDIFF_BIG was introduced in SQL Server 2016 on-premises, Azure SQL Database and Azure SQL Data Warehouse. So I bet a lower version on-premises SQL Server in your scenario? I think that's why you see the latter part of the error "'DATEDIFF_BIG' is not a recognized built-in function name".
Regarding the forepart "The following exception ...", that's a typical .NET language(C# in PowerBI I guess) exception when a problematic interaction happens between C# and database.
I will report this internally and our engineers will evaluate it.
Base on my understanding, that is a potential bug or an intentional design(maybe only the compability with Azure SQL products is considered, as they are hot and cloud).
In the DirectQuery mode connecting to a SQL Server source, the calcuated column in DAX is "translated" to Transact-SQL(T-SQL, SQL Server query and programing language). Database engine runs the translated T-SQL and returns the query result ideally.
In this case, DATEDIFF in DAX is most probably translated to DATEDIFF_BIG in T-SQL, however DATEDIFF_BIG was introduced in SQL Server 2016 on-premises, Azure SQL Database and Azure SQL Data Warehouse. So I bet a lower version on-premises SQL Server in your scenario? I think that's why you see the latter part of the error "'DATEDIFF_BIG' is not a recognized built-in function name".
Regarding the forepart "The following exception ...", that's a typical .NET language(C# in PowerBI I guess) exception when a problematic interaction happens between C# and database.
I will report this internally and our engineers will evaluate it.
Hi Eric
Any updates on this issue?
TY
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
82 | |
67 | |
61 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |