Forum Discussion
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”
- 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”?
- Anonymous6 years ago
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
- AnonymousNot applicable
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- gauravnarchalPost Prodigy
Thank you Anonymous