Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Data for Above (These all match the filter but the blank values should be ignored as shown below in calculation)
Calculation:
Any ideas?
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.
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.
Proud to be a Super User!
User | Count |
---|---|
11 | |
8 | |
5 | |
5 | |
4 |
User | Count |
---|---|
16 | |
14 | |
8 | |
6 | |
6 |