Forum Discussion

FabvE's avatar
FabvE
Helper I
1 year ago
Solved

Count rows containing string from other table column

Hi, I already tried some solutions ( like CountRows where column A contains a string and col... - Microsoft Fabric Community or Solved: Count rows containing value - Microsoft Fabric Community ) but...
  • rajendraongole1's avatar
    1 year ago

    Hi FabvE -  we need to refine the DAX logic to correctly evaluate rows with multiple email addresses. 

    Kennzahl =
    CALCULATE(
    COUNTROWS(final_output),
    FILTER(
    final_output,
    CONTAINSSTRING(
    SUBSTITUTE(final_output[owner_final], " ", ""),
    SELECTEDVALUE(OwnerUnique[owner_mail])
    )
    )
    )

     

    Alternatively, use a calculated table in DAX to create a normalized version of final_output.

     

    Hope this works.

  • AnkitaaMishra's avatar
    1 year ago

    Hi FabvE , Tried with sample data as below : 


    you can modify your dax as below : 
    Measure =
    CALCULATE(
    COUNTROWS(final_output),
    FILTER(
    final_output,
    NOT(ISBLANK(SELECTEDVALUE(OwnerUnique[owner_mail]))) &&
    CONTAINSSTRING(final_output[owner_final], SELECTEDVALUE(OwnerUnique[owner_mail]))
    )
    )


    Thanks, 
    Ankita