Forum Discussion
Handling NULL values
- 5 years ago
Hi,
The Data type of the column should be decimal and you should not feel the need to replace null with 0. Your visuals should work perfectly. Can you share the file's download link and show the exact problem.
Hi,
The Data type of the column should be decimal and you should not feel the need to replace null with 0. Your visuals should work perfectly. Can you share the file's download link and show the exact problem.
Thanks heaps Ashish. When data type converted to Decimal, yes the visualization works fine even with the NULL values
Little bit curious about below:
- The column has NULL values in SQL server database which I extracted to Excel table (as the machine I am working on does not have SQL Server DB connection). So, this Excel table is the source of my power BI.
- When data is exported from the Excel, Power Query Editor shows the null values as NULL
- When data type is converted to decimal, the null values becomes null in Power Query Editor window
- When "Close and Apply", the table in DAX or main PowerBI windows, shows the null values as blank
- The same column also contains values which are 0s (zero). So,the column now contaions number values, 0 and blank values.
- Now, while using that column in IF condition, 0s are also treated as being blank
This is bit strange to me. Anyway, I found a way to deal with 0 being treated as blank by using ISBLANK() function. So, all good. If you can shed some light why Power BI treats NULL as explained above, would be great.
Thanks again Ashish.
- Ashish_Mathur5 years agoSuper User
You are welcome. In the Query Editor, Null is treated as blank.