Forum Discussion

lamp38's avatar
lamp38
New Member
7 years ago

Count of Rows which Contain Term?

This seems like it should be really simple, but I'm having a difficult time finding the answer.  

 

I have a bunch of survey responses from from an testing group that I want to organize:

 

  1. One of the columns in this data set is the users feedback, which is a string of text the user provided
  2. I want to be able to show a show a visual which shows the number of complaints which contain a given term (slow, frozen, crash, etc.).  

  3. Example: Total 1000 responses.  200 contain "slow",  5 contain "frozen", 5 contain "crash". 

 

For the purpose of this question you can assume my data set has two columns, responder age and feedback string.

(Some feedback strings may contain more than one of my key terms.) 

 

Thanks!

6 Replies

  • AlB's avatar
    AlB
    Community Champion

    Hi lamp38

     

    If you place a matrix visual in your report and set ' feedback string' in the rows and also in values and select to summarize as 'Count' you should get something like what you are describing

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi lamp38,

     

    Have you solved your problem?

     

    If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

     

    If you still need help, please share some data sample and your desired output so that we could get the solution more quickly.

     

    Best  Regards,

    Cherry

  • Hi,

     

    Sounds like an interesting one to solve.  Share some data and show the expected result.  Especially show cases where the feedback string has multiple key terms and your expected result for those cases.

    • lamp38's avatar
      lamp38
      New Member

      Imagine we have the following rows: 

       

      1. Complaint 1: "App is very slow." 
      2. Complaint 2: "App loads slowly." 
      3. Compaint 3: "The app was very slow, and then crashed." 

      I have to be able to summarize the data as follows: 

      • Count (slow) = 3
      • Count (crashed) = 1
      • AlB's avatar
        AlB
        Community Champion

        Hi lamp38

         

        Try this:

         

        1. Create a one-column table Terms in which you have the terms you want to look for

        2. Place Terms[Term] on the rows of a matrix visual

        3. Place this measure in values of the matrix:

         

         

        Measure =
        VAR _CurrentTerm =
            SELECTEDVALUE ( Terms[Term] )
        RETURN
            COUNTROWS (
                FILTER ( Table1, FIND ( _CurrentTerm, Table1[feedback string], 1, 0 ) > 0 )
            )