Forum Discussion

Lebunim's avatar
Lebunim
Regular Visitor
4 years ago
Solved

Count Keywords in Summary Column from another table

Hi Guys,  I tried to find solution in the Forum but failed each and everytime.  I'm actually looking for a simple thing, I have two tables : 1. Keywords 2. Incidents   I want to know how many t...
  • v-chenwuz-msft's avatar
    4 years ago

    Hi Lebunim ,

     

    You can try use substitute() to replace the word in this summary string to null. Then calculate the reduced number of characters, finally divide it by the length of keyword.

    Modify the measure to suit your mode.

    count word =
    VAR _text =
        FIRSTNONBLANK ( 'Table 2 - Incidents'[text], 1 )
    VAR _len_text =
        LEN ( _text )
    VAR _len_key =
        LEN ( [Keywords] )
    VAR _substitute =
        LEN ( SUBSTITUTE ( _text, [Keywords], "" ) )
    RETURN
        DIVIDE ( _len_text - _substitute, _len_key )
    

     

    Result: 

    Pbix in the end you can refer.

    Best Regards

    Community Support Team _ chenwu zhu

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.