Forum Discussion

KPME's avatar
KPME
New Member
3 years ago
Solved

Filter Column based on two string options

Hello everyone,

 

for one string filter the following works: 

NewColumn = CALCULATE(DISTINCTCOUNT(table[ID]),FILTER(table,CONTAINSSTRING(table[OPTIONS],"String01")))
 
However for two strings I tried this (but doesn't work):
NewColumn = CALCULATE(DISTINCTCOUNT(table[ID]),FILTER(table,CONTAINSSTRING(table[OPTIONS],"String01"+"String02))))
 
Kind regards
  • Hii,

    Does this work?

    NewColumn = CALCULATE(DISTINCTCOUNT(table[ID]),FILTER(table,CONTAINSSTRING(table[OPTIONS],"String01")||CONTAINSSTRING(table[OPTIONS],"String02")))

    Hope this helps.

4 Replies

  • Hii,

    Does this work?

    NewColumn = CALCULATE(DISTINCTCOUNT(table[ID]),FILTER(table,CONTAINSSTRING(table[OPTIONS],"String01")||CONTAINSSTRING(table[OPTIONS],"String02")))

    Hope this helps.

  • Jayee's avatar
    Jayee
    Responsive Resident

    Hi KPME 

     

    For the second column use AND (&&), OR (||) operator insted of "+" sign based on your requirement 

     

    If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!

    • KPME's avatar
      KPME
      New Member

      Hey! this doesn't result in any errors, however it does result in an error in the visual which I can't explain 😞 

      • Jayee's avatar
        Jayee
        Responsive Resident

        may be you can provide sameple data without sensitive information so i can able to support you further.