This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I am trying to calculate my NPS scores but it is counting blanks in the distractors and total rows.
Solved! Go to Solution.
Hi @Anonymous ,
If you want to use <> blank in your formula, the measure should be like this:
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
)
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @Anonymous
instead of using COUNTROWS (that counts the rows of table) you can use COUNTA, where you have to reference to a column. This function counts all values that are not empty.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
hey, on the calculate segment filter for this dax add a filter as follow:
calculate(expresion, "filter" nps score column <>BLANK())
that <>blank() filter will make it only calculate for the no blank cells in that column you spacify
if this helped please mark as solution, if you liked it give some kudos. 🙂
Proud to be a Super User!
I tried the following but did not seem to work.
Hi @Anonymous ,
If you want to use <> blank in your formula, the measure should be like this:
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
)
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.