Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Nickodemus
Helper III
Helper III

DAX 'IN' operator not working as expected (at all actually)

Hi All,

 

I'm getting a syntax error when using the 'IN' operator - it's not presenting as an error in the DAX editor bar (i.e. the measure doesn't present as an error), but only when the measure is used in a visual - e.g. the measure appears to be fine, and showing no errors, but then i use the measure in a tile, and it errors stating there is a syntax error.

 

I've also tried writing the measure in DAX in an SSAS tabular model, and do get the same syntax error - if someone could assist I'd appreciate it.

 

Current Sales Count := 
CALCULATE(
DISTINCTCOUNT('FactSales'[Sales ID]),
	FILTER('dimSalesAttributes',[Current Status] IN { "Held","Reserved" })
)

I've used 'IN' before in exactly the same way, and it's worked fine, but this is odd. I've also tried literally copying and pasting the 'IN' example from the DAX documentation and simply changed the field references, and still get the syntax error. 

I realise the Filter function isn't necessary, but it's in this one as it's the last version i tried.

 

Many thanks,

 

Nick

11 REPLIES 11

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.