Forum Discussion

New_Folder's avatar
New_Folder
Helper I
1 year ago
Solved

How do I COUNT IF CONTAINS?

How do I count the number of colors in Table1, Value if it CONTAINS the color in Table 2 Color   I tried the formula below but it only counts the actual Value but not IF IT CONTAINS   COUNT = CA...
  • DataInsights's avatar
    1 year ago

    New_Folder,

     

    Try this calculated column in Table2:

     

    Count =
    VAR vColor = Table2[Color]
    VAR vResult =
        COUNTROWS ( FILTER ( Table1, CONTAINSSTRING ( Table1[Value], vColor ) ) )
    RETURN
        vResult