Forum Discussion
DAX - Error on trying to return tables from an IF() statement
- 9 years ago
In DAX, you can't specify a dynamic filter context in CALCULATE(). And what IF statement returns should be value, if the value_if_ture is a column, it returns the value that corresponds to the current row. You can't make it returns a table context which contains multipe columns as the error message mentioned.
Regards,
In DAX, you can't specify a dynamic filter context in CALCULATE(). And what IF statement returns should be value, if the value_if_ture is a column, it returns the value that corresponds to the current row. You can't make it returns a table context which contains multipe columns as the error message mentioned.
Regards,
Thanks for the insight Simon. I found a way around, changing one of my tables to ensure the query wouldn't end up empty and always get a meaningful result back - this has the side effect of having data in there which we don't care about, but it can be filtered out :)