Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Create an NPS Measure filtering a Column

First I was given this measure formula to create my NPS score, however my NPS score is in the Answer column and NPS is just one of three questions that were asked. There are two other questions in that column i.e. Support, NPS, Products. How do I use this formula while filtering the Question column for NPS? If the NPS formula could be better I'm open to suggestions, I'm a beginner with Measures.

 

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    In your code, I don't think the passives part of the var value is used.

    Update Measure:

    NPS Score =
    VAR detractors =
        CALCULATE (
            COUNTROWS ( 'Your Table' ),
            FILTER (
                'Your Table',
                'Your Table'[Question] = "NPS"
                    && 'Your Table'[Answer] <= 6
            )
        )
    VAR promoters =
        CALCULATE (
            COUNTROWS ( 'Your Table' ),
            FILTER (
                'Your Table',
                'Your Table'[Question] = "NPS"
                    && 'Your Table'[Answer] >= 9
            )
        )
    VAR total =
        COUNTROWS ( 'Your Table' )
    VAR score =
        ( DIVIDE ( promoters, total ) * 100 )
            - ( DIVIDE ( detractors, total ) * 100 )
    RETURN
        IF ( ISBLANK ( score ), 0, score )

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.