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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Count Text Measure

Hi I have a measure that will let me know if someone is expected to make a target

 

Expected to Make Target = IF([Hours needed per Month]<=[MTD Expected Hours]+40, "Yes", "No")
 
However, I don't seem to be able to be able to put it in a pie chart or on a card to see the number of people that is "Yes" or "No". 
 
Any suggestions.  The Format is Text. 
1 ACCEPTED SOLUTION

Hey @Anonymous 

Create the following two measure

 

Count of No = CALCULATE(COUNT(SQL[Expected to Make Target]), SQL[Expected to Make Target] = "No")
 
Count of Yes = CALCULATE(COUNT(SQL[Expected to Make Target]), SQL[Expected to Make Target] = "Yes")

and use them to plot cards and pie charts, you will get following result

Dhairya_0-1689055831561.png

If this helps you, please mark my solution as accepted so that others can find this quickly when they face a similar issue. Thank you!

View solution in original post

10 REPLIES 10
Ahmedx
Super User
Super User

pls try this

CALCULATE(COUNTROWS(SQL), 
         FILTER(
             ALL(SQL)
               ,[Expected to Make Target]= "No"))
Dhairya
Solution Supplier
Solution Supplier

Hey @Anonymous 
One workaround is that create a Calculated column instead of measure with the same Dax code and plot it in the value field of the pie chart.

If this helps you, please mark my solution as accepted so that others can find this quickly when they face a similar issue. Thank you!

Anonymous
Not applicable

I want to see a number like a the Number of No expected not to make target, but when I put in card view it does not give me an option to count.  Intstead it just shows No

expected to make target.JPG

I tried putting in count display name and then filtering it by No but I get 3,932, however there should only be 3 

 

target.JPG

I've tried a use the measure = 

CALCULATE(COUNTROWS(SQL), FILTER(SQL,[Expected to Make Target]= "No")), however that gave me 44, however it should be 3. 

Hey @Anonymous 

Create the following two measure

 

Count of No = CALCULATE(COUNT(SQL[Expected to Make Target]), SQL[Expected to Make Target] = "No")
 
Count of Yes = CALCULATE(COUNT(SQL[Expected to Make Target]), SQL[Expected to Make Target] = "Yes")

and use them to plot cards and pie charts, you will get following result

Dhairya_0-1689055831561.png

If this helps you, please mark my solution as accepted so that others can find this quickly when they face a similar issue. Thank you!

Anonymous
Not applicable

@Dhairya 

 

I'm getting an error. I'm not sure if it is because "Expected to make Target" is a measure 

 

count No.JPG

Yes @Anonymous please convert your measure to the calculated column, it will work perfectly.

Anonymous
Not applicable

Sorry I don't know how to make it a calculated column

@Anonymous 

Dhairya_0-1689056374616.png

Please find the above image it will help you for creating column

 

Anonymous
Not applicable

Thank you,  It worked, however,  I think the problem is with my original measure. When I put the data in the  people are coming up as both and I think that is messing up the count. Kass should be "yes"

yes.JPGNo.JPG

Hey @Anonymous 
If this helps you, please mark my solution as accepted so that others can find this quickly when they face a similar issue. Thank you!

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.