Forum Discussion

gauravnarchal's avatar
gauravnarchal
Post Prodigy
6 years ago
Solved

Add column and Sum based on text value

Need help!!!

 

I am having 1 table as below and want to add 4 columns as “Delighted”,”Satisfied”,”Very Satisfied”,”Dissatisfied”

  1. How can add the column with the logic
  • Of each row, how can I sum “25%” to the text “Delighted” from each column “B,C,D,E”?

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi gauravnarchal 

     

    I have abbriviated the column names and you can use it as per your need.

     

    Below is the screenshot of the output and column DAX formula.

    Change the new created columns to percentage as in the screen shot to see the data in %

     

     

     

    Dlighted      = IF('Table'[A]="DL",.25,0)+IF('Table'[B]="DL",.25,0)+IF('Table'[C]="DL",.25,0)+IF('Table'[D]="DL",.25,0)
    Very Satisfied= IF('Table'[A]="VS",.25,0)+IF('Table'[B]="VS",.25,0)+IF('Table'[C]="VS",.25,0)+IF('Table'[D]="VS",.25,0)
    Satisfied     = IF('Table'[A]="S",.25,0)+IF('Table'[B]="S",.25,0)+IF('Table'[C]="S",.25,0)+IF('Table'[D]="S",.25,0)
    Dissatisfied  = IF('Table'[A]="DS",.25,0)+IF('Table'[B]="DS",.25,0)+IF('Table'[C]="DS",.25,0)+IF('Table'[D]="DS",.25,0)

     

     

     

     

    Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

    Regards,
    Pranit

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi gauravnarchal 

     

    I have abbriviated the column names and you can use it as per your need.

     

    Below is the screenshot of the output and column DAX formula.

    Change the new created columns to percentage as in the screen shot to see the data in %

     

     

     

    Dlighted      = IF('Table'[A]="DL",.25,0)+IF('Table'[B]="DL",.25,0)+IF('Table'[C]="DL",.25,0)+IF('Table'[D]="DL",.25,0)
    Very Satisfied= IF('Table'[A]="VS",.25,0)+IF('Table'[B]="VS",.25,0)+IF('Table'[C]="VS",.25,0)+IF('Table'[D]="VS",.25,0)
    Satisfied     = IF('Table'[A]="S",.25,0)+IF('Table'[B]="S",.25,0)+IF('Table'[C]="S",.25,0)+IF('Table'[D]="S",.25,0)
    Dissatisfied  = IF('Table'[A]="DS",.25,0)+IF('Table'[B]="DS",.25,0)+IF('Table'[C]="DS",.25,0)+IF('Table'[D]="DS",.25,0)

     

     

     

     

    Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

    Regards,
    Pranit