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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
stevenlong85
New Member

Change a blank string text value to 0 in power bi

Hi,

 

I'm having some trouble with a string text column I have, its called: "Task Status" within Task status there are some blank values

 

Column: 

Complete

Not Started

 

In Progress

 

Etc, 

 

I followed some guides online and they are mostly geared up to creating measures of which the column needs to be numeric value to work, but I can't figure out how to pull a "0" for the count of a blank text string.

 

Can anyone help?

 

Thanks,

1 ACCEPTED SOLUTION
Kaviraj11
Super User
Super User

Try this -

Task Status Measure =
IF(
ISBLANK(SELECTEDVALUE('Table'[Task Status])),
0,
SELECTEDVALUE('Table'[Task Status])
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
Bibiano_Geraldo
Super User
Super User

Hi @stevenlong85 ,

Use the following DAX formula to create a measure that counts blank values:

Count_Blank_Status = 
CALCULATE(
    COUNTROWS('TableName'),
    ISBLANK('TableName'[Task Status])
)

If You Want to Replace Blanks with "0" or Another Default Value create a New Calculated Column in your table with this DAX formula:

Task_Status_Filled = 
IF(
    ISBLANK('TableName'[Task Status]),
    "0", -- Replace with any value you want
    'TableName'[Task Status]
)

Also you can replace the Blank Values (null values) in power query:
1- Go to power query, select the disered column, and choose replace values:

Bibiano_Geraldo_0-1738081816545.png

2- Now in Value to find keep blank and in replace with choose 0:

Bibiano_Geraldo_1-1738081913942.png


Now you can close and apply.

Kaviraj11
Super User
Super User

Try this -

Task Status Measure =
IF(
ISBLANK(SELECTEDVALUE('Table'[Task Status])),
0,
SELECTEDVALUE('Table'[Task Status])
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





WOW! super fast response and this worked perfectly! 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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