Forum Discussion

tanvi_m's avatar
tanvi_m
Frequent Visitor
6 years ago
Solved

Repeated Text in Cell

In my Power BI one row table, I have a cell with multiple entry of words AA and BB with prefix of new. I need to count how many times each (AA and BB) are associated with new. For example in below example, I should have AA: 2 and BB : 2

 

example

ValueDetails
Z
 Replace existing BB antenna on 1 with new BB .  Add 1x new AA on an existing bracket.

 Replace existing BB  antenna with new . Replace existing AA with 1x new AA

4 Replies

  • tanvi_m try following measures

     

    AA Count = CALCULATE( COUNTROWS ( 'Table' ), CONTAINSSTRING ( 'Table'[Text], "AA" ) )
    
    BB Count = CALCULATE( COUNTROWS ( 'Table' ), CONTAINSSTRING ( 'Table'[Text], "BB" ) )
    • tanvi_m's avatar
      tanvi_m
      Frequent Visitor

      Thankyou parry2k , but using this formula I am getting 1. Even tried replacing "AA" with "*AA*". Result still remains the same 

      • parry2k's avatar
        parry2k
        Super User

        tanvi_m interesting I'm getting 2 for both AA and BB from your sample data.