Forum Discussion
The syntax for 'IN' is incorrect error
Thanks for the suggestions. I need to use IN operator becuase I have a large number of different comparisons. The full expression looks like this:
IF (
'Unit Information'[Unit Type] IN { "1PAT","1BF" },
"Frontline Patrol",
IF ( 'Unit Information'[Unit Type]="1SGT",
"Frontline Admin",
IF (
'Unit Information'[Unit Type] IN { "2MAR","2DIVE","2EDU","2K9","2MCB","2OPS","2PSU","2RBU","2TAC","2TMED","3COAST","4MOTO","4RIDE","4RTRF","4SAP","5YED" },
"Regional Support", "Other Support"
)
)
)
I shortened it to validate the syntax.
I'm using it inside an SSAS tabular model. When I render the object in Power BI Desktop, it gives the error.
I also tried the SWITCH function. But problem with SWITCH is that it only allows a max of 10 values when used with a linked server. This is not DAX limitation but SQL Server linked server limitation.
Also check regional seperator setting on your system.
And make sure you are using latest version of power bi desktop and server version.
Thanks,
Pravin