This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Only seen using the Access.Database connector. The bug causes Query Folding to erroneously add the condition "where 0 = 1" to the SQL query so no rows are returned.
To reproduce the issue:
The incorrectly folded query looks like the below. The error is on the last line, "where 0 = 1"
select [_].[ID],
[_].[Title],
[_].[Custom]
from
(
select [_].[ID] as [ID],
[_].[Title] as [Title],
switch(
[_].[ID] MOD 2 = 0 and [_].[ID] MOD 2 is not null, true,
1, false
) as [Custom]
from [Table1] as [_]
) as [_]
where 0 = 1
If you use any values other than 0 for false and -1 for true, the query will fold correctly, e.g:
select [_].[ID],
[_].[Title],
[_].[Custom]
from
(
select [_].[ID] as [ID],
[_].[Title] as [Title],
switch(
[_].[ID] MOD 2 = 0 and [_].[ID] MOD 2 is not null, -2,
1, -1
) as [Custom]
from [Table1] as [_]
) as [_]
where [_].[Custom] = -1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.