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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Dom87326
Helper II
Helper II

% based on count ignoring blank()

Hello, 

 

I'm trying to build a dax formula that counts % of non discinct RespondentId by total RespondentId (ignoring blanks).

 

The desired outcome should be like in column % of GT of RespondentId <> Blanks.

 

 

QuestionRespondentIdAnswer% of GT of RespondentId <> Blanks
What's your favorite city 39Lora del Río11%
What's your favorite city 69Marchena11%
What's your favorite city 71Moron de la Frontera11%
What's your favorite city 31Barcelona11%
What's your favorite city 57Madrid11%
What's your favorite city 38  
What's your favorite city 68  
What's your favorite city 81Huesca44%
What's your favorite city 53Huesca44%
What's your favorite city 16Huesca44%
What's your favorite city 64Huesca44%

 

Thanks!

1 ACCEPTED SOLUTION
AilleryO
Memorable Member
Memorable Member

Hi,

 

Not 100% sure, but I will try to help :

Count Non Blank Answers = 
VAR CountNonBlankAnswers=CALCULATE( COUNT( TabAnswers[RespondentId] ) , NOT ISBLANK( TabAnswers[Answer] ) )
RETURN
CountNonBlankAnswers
 
Will give you the count of answers not blank. Then if you want to count each type of answer, this would do the job :
Count Non Blank Answers / Answer = 
VAR CurrentAnswer= SELECTEDVALUE( TabAnswers[Answer] )
VAR CountNonBlankAnswers=CALCULATE( COUNT( TabAnswers[RespondentId] ) , NOT ISBLANK( TabAnswers[Answer] ) , TabAnswers[Answer] = CurrentAnswer )
RETURN
CountNonBlankAnswers
 
Then if those are the count you need, you'll just have to divide :
% of answers = DIVIDE ( Count Non Blank Answers , Count Non Blank Answers / Answer , 0 )
and get that :
AnswersPourcentage.png
Hope it helps

View solution in original post

1 REPLY 1
AilleryO
Memorable Member
Memorable Member

Hi,

 

Not 100% sure, but I will try to help :

Count Non Blank Answers = 
VAR CountNonBlankAnswers=CALCULATE( COUNT( TabAnswers[RespondentId] ) , NOT ISBLANK( TabAnswers[Answer] ) )
RETURN
CountNonBlankAnswers
 
Will give you the count of answers not blank. Then if you want to count each type of answer, this would do the job :
Count Non Blank Answers / Answer = 
VAR CurrentAnswer= SELECTEDVALUE( TabAnswers[Answer] )
VAR CountNonBlankAnswers=CALCULATE( COUNT( TabAnswers[RespondentId] ) , NOT ISBLANK( TabAnswers[Answer] ) , TabAnswers[Answer] = CurrentAnswer )
RETURN
CountNonBlankAnswers
 
Then if those are the count you need, you'll just have to divide :
% of answers = DIVIDE ( Count Non Blank Answers , Count Non Blank Answers / Answer , 0 )
and get that :
AnswersPourcentage.png
Hope it helps

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.