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
dudu55
Frequent Visitor

isblank is not working as it should

trying to "if" isblank , i want in case a value of a field is null then new column should be 1 else it should be 0 

 

i've dont it like that : 

counterror = IF(ISBLANK(Dudu_bi[WEIGHTDIFF]),1,0)
 in case of condition 0 is works well but for the isblank condition it gives back null value and not 1 111.png
1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @dudu55 ,

Here you use isblank to create a calculated column in 'Dudu_bi' table. Please check whether 'Dudu_bi' table has datetime 2020/04/07 13:46:53. I think your problem should be caused that there is no datetime 2020/04/07 13:46:53 in 'Dudu_bi'. So this calculated column will return blank when you add it in visual.

I suggest you to try to create a measure.

counterror = IF(ISBLANK(MAX(Dudu_bi[WEIGHTDIFF])),1,0)

You see left one is a calculated column by your code. I will get the same result like you. Right one is my measure, it works well.

1.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-rzhou-msft
Community Support
Community Support

Hi @dudu55 ,

Here you use isblank to create a calculated column in 'Dudu_bi' table. Please check whether 'Dudu_bi' table has datetime 2020/04/07 13:46:53. I think your problem should be caused that there is no datetime 2020/04/07 13:46:53 in 'Dudu_bi'. So this calculated column will return blank when you add it in visual.

I suggest you to try to create a measure.

counterror = IF(ISBLANK(MAX(Dudu_bi[WEIGHTDIFF])),1,0)

You see left one is a calculated column by your code. I will get the same result like you. Right one is my measure, it works well.

1.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@dudu55 ,  Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

This formula is correct

counterror = IF(ISBLANK(Dudu_bi[WEIGHTDIFF]),1,0)

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.