Forum Discussion
Alternative syntax to CONTAINSSTRING using Direct Connect to SSAS
- 5 years ago
Hi cklopper ,
Sorry for replying late. Plese check the SSAS version you are running as the CONTAINSSTRING function only works from >= SSAS 2019 CTP2.3.
You can refer this simliar issue:
Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
cklopper , Alternative for CONTAINSTRING might be FIND.
Meanwhile, you can use the following DAX:
Original DAX:
CALCULATE(Account[Total Count Account Codes],
CONTAINSSTRING(Account[RegionalAccountClass],"abc" ) ||
CONTAINSSTRING('Account'[RegionalAccountClass] = "xyz"))
New DAX:
CALCULATE(Account[Total Count Account Codes],
OR(
CONTAINSSTRING(Account[RegionalAccountClass],"abc" ),
CONTAINSSTRING('Account'[RegionalAccountClass], "xyz")
)
Anonymous, amitchandak thanks for the suggestions. Unfortunately CONTAINSSTRING doesn't work because I'm connected directly to SQL Server Analysis Services. It's not available as a function and PBI Desktop won't recognise it... 😞