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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
justlearning50
Frequent Visitor

Count items with a certain value using a measure but return 0 if no value exists

Hi,

I have what I hope is an easy problem - I have a table with a column 'Skill Achieved'. The data is either 'Skill Achieved' or 'Skill Gap' based on a conditional statement on the individual results.

I created a measure that counts all the value of 'Skill Achieved' in a table as shown:

justlearning50_0-1702988623119.png

This works great except it does not return a zero if the skill is not achieved by anyone as shown below 

justlearning50_1-1702989890687.png

just gives a blank in 'Num Achieved Skill' Is there a way around this? 

NOTE: I do not want to show the 'Total Num of Results' measure in my report, so with just the 'Num Achieve Skill' column, many of my skills are omitted (which I do not want..)

I hope this is clear.

Thanks in advance for your help. 

M

2 ACCEPTED SOLUTIONS
Dangar332
Super User
Super User

HI, @justlearning50 

 

add +0 at end of your dax code like below
measure =
 calculate (

)+ 0

View solution in original post

PijushRoy
Super User
Super User

Hi @justlearning50 

Please update your DAX

New Achieved Skill = 
IF(
ISBLANK(
Your full code code here),0,
Your full code code here)

 

Please paste your full DAX done in "Your full DAX code here" 

If solved your requirement, please mark this answer as SOLUTION.
If this comment helps you, appreciate your KUDOS

Thanks
Pijush

View solution in original post

4 REPLIES 4
justlearning50
Frequent Visitor

Thanks guys @PijushRoy , @Dangar332 , both options seem to work. Much appreciated.

PijushRoy
Super User
Super User

Hi @justlearning50 

Please update your DAX

New Achieved Skill = 
IF(
ISBLANK(
Your full code code here),0,
Your full code code here)

 

Please paste your full DAX done in "Your full DAX code here" 

If solved your requirement, please mark this answer as SOLUTION.
If this comment helps you, appreciate your KUDOS

Thanks
Pijush

Dangar332
Super User
Super User

HI, @justlearning50 

 

add +0 at end of your dax code like below
measure =
 calculate (

)+ 0

Thanks for coming back so quickly @Dangar332 . That has worked. It leaves me with a different issue, but hopefully one I can fix. Thanks again.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.