Forum Discussion

Hugo_Wass's avatar
Hugo_Wass
Regular Visitor
4 years ago
Solved

ContainsString with OR function

Hi there - PowerBi newbie here:

Could anybody highlight the error in my DAX expression below:

No of people with retakes = CALCULATE(DISTINCTCOUNT('people (2)'[Person ID]), FILTER('auditlogs all',CONTAINSSTRING('auditlogs all'[Description], OR("Sent Retake", "Sent Redo"))
))


I am trying to count the number of people in 'people' with auditlogs all'[Description] containing either "Sent Retake" or "Sent Redo"

I get no immediate error in the dax formula bar but when i try to add the measure to a visual i get the following error:


Any help would be appreciated.



 

  • Could you try: 

     

    No of people with retakes = CALCULATE(DISTINCTCOUNT('people (2)'[Person ID]), FILTER('auditlogs all',CONTAINSSTRING('auditlogs all'[Description], "Sent Retake") || CONTAINSSTRING('auditlogs all'[Description], "Sent Redo")))

     

    The "||" operator represents OR in DAX. "&&" can be used for AND

     

2 Replies

  • Adescrit's avatar
    Adescrit
    Impactful Individual

    Could you try: 

     

    No of people with retakes = CALCULATE(DISTINCTCOUNT('people (2)'[Person ID]), FILTER('auditlogs all',CONTAINSSTRING('auditlogs all'[Description], "Sent Retake") || CONTAINSSTRING('auditlogs all'[Description], "Sent Redo")))

     

    The "||" operator represents OR in DAX. "&&" can be used for AND