Forum Discussion
stevenlong85
1 year agoNew 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,...
- 1 year ago
Try this -
Task Status Measure =
IF(
ISBLANK(SELECTEDVALUE('Table'[Task Status])),
0,
SELECTEDVALUE('Table'[Task Status])
)
Bibiano_Geraldo
Super User
1 year agoHi 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:
2- Now in Value to find keep blank and in replace with choose 0:
Now you can close and apply.