Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Filtered NPS showing 200$?

I have an NPS score being calculated which works fine under normal circumstances. Once I add a filter to look at a specific service line, the value changes to 200% and I cant figure out how the calculation would show that. 

 

Visual

cwileyrrt_0-1609952567272.png

 

Data for Above (These all match the filter but the blank values should be ignored as shown below in calculation)

 

 

Calculation:

Calculated NPS = VAR _participantAdvocates = CALCULATE ( COUNTROWS ( 'Primary' ), FILTER ( ALL ( 'Primary' ), 'Primary'[NPS Score] >= 9 && 'Primary'[NPS Score] <> BLANK () ) ) VAR _participantDetractors = CALCULATE ( COUNTROWS ( 'Primary' ), FILTER ( ALL ( 'Primary' ), 'Primary'[NPS Score] <= 6 && 'Primary'[NPS Score] <> BLANK () ) ) VAR _totalParticipantResponses = CALCULATE ( COUNTROWS ( 'Primary' ), 'Primary'[NPS Score] <> BLANK () ) RETURN DIVIDE ( _participantAdvocates - _participantDetractors, _totalParticipantResponses )

 

 

Any ideas?

2 REPLIES 2
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

You may try the following measure to see if it works.

 

Calculated NPS =
VAR _participantAdvocates =
    CALCULATE (
        COUNTROWS ( 'Primary' ),
        FILTER (
            ALL ( 'Primary' ),
            'Primary'[NPS Score] >= 9
                && 'Primary'[NPS Score] <> BLANK ()
        )
    )
VAR _participantDetractors =
    CALCULATE (
        COUNTROWS ( 'Primary' ),
        FILTER (
            ALL ( 'Primary' ),
            'Primary'[NPS Score] <= 6
                && 'Primary'[NPS Score] <> BLANK ()
        )
    )
VAR _totalParticipantResponses =
    CALCULATE (
        COUNTROWS ( 'Primary' ),
        FILTER ( ALL ( 'Primary' ), 'Primary'[NPS Score] <> BLANK () )
    )
RETURN
    DIVIDE (
        _participantAdvocates - _participantDetractors,
        _totalParticipantResponses
    )

 

 

Best Regards

Allan

 

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

StefanoGrimaldi
Resident Rockstar
Resident Rockstar

hey,

try simplifying that measure first, something like this should work: 

Calculated NPS =

Var primary2 = filter("primary", [NPS Score] <> Blank() )

Var Total = count("primary2"[NPS Score])

Var PBenefecators = (calculate(count(primary2[NPS Score]), primary[NPS Score] >=8)) / Total

Var PDetractors = (calculate(count(primary2[NPS Score]), primary[NPS Score] <=6)) / Total

 

return PBenefactors - PDetractors

 

this should work, 

f this solved your problem please mark it as solution for others to find more easily, if you liked the solution give some kudos. 





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors