Forum Discussion
NPS Calculation in BI
- 6 years ago
You should be able to do this with something like the following:
NPS Score = VAR _advocates = CALCULATE( COUNTROWS(Table), Table[Likely to Recommend] >= 9 ) VAR _detractors = CALCULATE( COUNTROWS(Table), Table[Likely to Recommend] >= 9 ) VAR _totalResponses = CALCULATE( COUNTROWS(Table ) ) RETURN DIVIDE( _advocates - _detractors, _totalResponses ) - 6 years ago
jcastr02 wrote:
How can we make it if, the NPS Score is 0 to show 0. Right now if the result is 0, the visual shows (blank).
Typically that would mean that the score is actually blank, but it is annoying how card visuals do not give you the option to display a 0 instead.
What I tend to do is to create a measure specially for cards that has something like =IF( ISBLANK( [NPS Score] ), 0 , [NPS Score] )
Generally this is not a good pattern as it forces a non-blank result which can hurt performance, but for visuals like cards it's OK.
You should be able to do this with something like the following:
NPS Score =
VAR _advocates = CALCULATE( COUNTROWS(Table), Table[Likely to Recommend] >= 9 )
VAR _detractors = CALCULATE( COUNTROWS(Table), Table[Likely to Recommend] >= 9 )
VAR _totalResponses = CALCULATE( COUNTROWS(Table ) )
RETURN DIVIDE( _advocates - _detractors, _totalResponses )
- jcastr026 years ago
Post Prodigy
d_gosbell this worked, thanks so much. I am trying to just make it show as a whole number. I was playing with the formula to just multiply by 100 to move decimal over but keep getting errors. Any ideas?
- jcastr026 years ago
Post Prodigy
disregard, I found it!! thanks again
- jcastr026 years ago
Post Prodigy
d_gosbell How can we make it if, the NPS Score is 0 to show 0. Right now if the result is 0, the visual shows (blank).
- d_gosbell6 years ago
Super User
jcastr02 wrote:
How can we make it if, the NPS Score is 0 to show 0. Right now if the result is 0, the visual shows (blank).
Typically that would mean that the score is actually blank, but it is annoying how card visuals do not give you the option to display a 0 instead.
What I tend to do is to create a measure specially for cards that has something like =IF( ISBLANK( [NPS Score] ), 0 , [NPS Score] )
Generally this is not a good pattern as it forces a non-blank result which can hurt performance, but for visuals like cards it's OK.