Forum Discussion

J_Mug's avatar
J_Mug
Helper I
6 years ago
Solved

Help: Calculating response rate in same column

Hi,   I have a matrix with my NPS and Number of responses by source, I wanted to add the response rate to that matrix. The problem is that there are 3 response rate measures in my model (Because I ...
  • v-lili6-msft's avatar
    6 years ago

    hi J_Mug 

    You may need to use SELECTEDVALUE or MAX in the formula as below:

    Var Web = DIVIDE(CALCULATE(COUNT('Table'[FeedbackSource]);FILTER('Table';'Table'[FeedbackSource]="Web"));SUM('Table2'[Count]);0)

    Var QR = DIVIDE(CALCULATE(COUNT('Table'[FeedbackSource]);FILTER('Table';'Table[FeedbackSource]="QR"));SUM('Table2'[Count]);0)

    Return

    If(SELECTEDVALUE('Table'[FeedbackSource])="Web";Web;IF('Table'[FeedbackSource]="QR;"QR").

     

    or

     

    Var Web = DIVIDE(CALCULATE(COUNT('Table'[FeedbackSource]);FILTER('Table';'Table'[FeedbackSource]="Web"));SUM('Table2'[Count]);0)

    Var QR = DIVIDE(CALCULATE(COUNT('Table'[FeedbackSource]);FILTER('Table';'Table[FeedbackSource]="QR"));SUM('Table2'[Count]);0)

    Return

    If(MAX('Table'[FeedbackSource])="Web";Web;IF('Table'[FeedbackSource]="QR;"QR").

     

    If you still have the problem, please share your sample pbix file and your expected output.

     

    Regards,

    Lin