Forum Discussion
Contains in a dax function
Hello,
I am trying to fiture out how to do contains in a dax function.
below is the dax function I users with works if the value is "Rejected". But in some cases the Offer Status contains some other charecters along with 'Rejected'.
Anonymous no you cannot use multiple, you need to add OR condition
CALCULATE(COUNTAX('Master','Master'[Offer Status]), CONTAINSSTRING('Master'[Offer Status] ,"Rejected") || CONTAINSSTRING('Master'[Offer Status] ,"Declined") )✨ Follow us on LinkedIn
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
2 Replies
- parry2kSuper User
Anonymous try this
CALCULATE(COUNTAX('Master','Master'[Offer Status]),CONTAINSSTRING('Master'[Offer Status] ,"Rejected") )✨ Follow us on LinkedIn
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- parry2kSuper User
Anonymous no you cannot use multiple, you need to add OR condition
CALCULATE(COUNTAX('Master','Master'[Offer Status]), CONTAINSSTRING('Master'[Offer Status] ,"Rejected") || CONTAINSSTRING('Master'[Offer Status] ,"Declined") )✨ Follow us on LinkedIn
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡