Forum Discussion
Replace blank values with "Null" keyword using measure
Hi,
I have a table visual with contains many date/time rows and columns.
There are many blank values in the table. Is it possible to replace all the blank values in the visual with text: "Null".
Can this be achieved with a measure rather than replacing the blank with "Null" in power query?
Can we replace the blank values in all columns in the table visual using a single measure rather than using multiple measures for multiple columns?
Any help would be appreciated.
Thank You
Note that if the measure here doesn't return text values, then you may get an error about IF returning different data types. You can fix this by wrapping the measure with FORMAT. and specifying the format you'd like (e.g. "General Date" or "yyyy-mm-dd" or "c" etc).
8 Replies
- ALLUREANSolution Sage
Hi, anandmitta
Try something like:
Measure = IF(ISBLANK(Table[Date]), "Null", Table[Date])
Did I answer your question? Please Like and Mark my post as a solution if it solves your issue. Thanks.
Appreciate your Kudos !!!
- anandmittaHelper I
When I use the ISBLANK() function and trying to select a column in the ISBLANK function, it's throwing error.
- ALLUREANSolution Sage
This is strange, can you share what is the error?
- Ashish_MathurSuper User
Hi,
Replacing in the same columns can only be done in the Query Editor.
- AnonymousNot applicable
Hi anandmitta ,
It seems you are using Live Connection mode. It means you can only make changes to it on the Desktop. So it seems that you can only use measures or use calculate table.
Please have a try.
NewTable = VAR midT = ADDCOLUMNS ( 'Table', "Date_", IF(ISBLANK('Table'[date]),"NULL",FORMAT('Table'[date],"YYYY-mm-dd")), "Start_",IF(ISBLANK('Table'[start]),"NULL",FORMAT('Table'[start],"YYYY-mm-dd"))) RETURN SELECTCOLUMNS ( midT, "Date", [Date_], "Start", [Start_] )Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.