Reputation: 171
I am trying to use the IN function is analysis services tabular, but it is returning me an error. I tried the same on my co-worker's machine and it is working perfectly. I have already uninstalled my data tools 2017 and 2015 and installed again. Now I have only SSDT 2015 and having this problem.
TestMeasureIN:=
CALCULATE(
COUNTROWS(DimDate),
DimDate[MonthName] IN {"may", "july"}
)
SEMANTIC ERROR: THE SYNTAX FOR 'IN' IS INCORRECT
Upvotes: 1
Views: 829
Reputation: 4790
The IN
function won't be available for versions of SSAS prior to 2017, so SSDT 2015 won't have this. You can rewrite this using CONTAINS
as follows. Also, I'm guessing that TestMeasureIN
is in your fact table as opposed to DimDate
? If so, change COUNTROWS
to the fact table to count the rows for the given months.
TestMeasureIN:=
CALCULATE (
COUNTROWS ( FactTableName),
FILTER (
ALL ( DimDate[MonthName]),
CONTAINS (
DATATABLE ( "MonthName", STRING, { { "may", "july"} } ),
[MonthName], DimDate[MonthName]
)
)
)
Upvotes: 3