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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.