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
IanDavies
Helper III
Helper III

Finding Null Values to resolve an error

I have a dataset and in one column I transform the name of computers to a common standard using this transformation:

 

= Table.AddColumn(
/* Add a column CleanName, this is used as a key field across all tables. */
#"Set Column Data Types", "CleanName",
/* check to see of the computer name is a SamAccountName if it is use that value */
each if Text.Length([Name]) <= 15 then Text.Upper([Name])
/* check to see if the computername is a Windows Hello Kerberos object, is so use that value */
else if Text.Contains([Name],"AzureADKerberos") then Text.Upper([Name])
/* assume that anything else, longer than 14 characters is a DNS Host name and extract the Hostname portion */
else Text.Upper(Text.BeforeDelimiter([DNSHostName],".")))

 

it works and as far as I can tell there are no obvious errors in Power Query

 

Column Quality says there are no empty values:

IanDavies_0-1723199211409.png

but when I try and sort on that column I get this error:

IanDavies_1-1723199238139.png

clicking the Go To Error button in the message takes me to the transformation above.

 

Selecting Keep Rows > Keep Errors gives the same error.

 

Any attempts to merge this table are also met with the "we cannot convert the value null to type logical"

IanDavies_2-1723199385172.png

 How can I track down these null values? 

 

1 ACCEPTED SOLUTION
SamWiseOwl
Super User
Super User

Hi @IanDavies 

Well done for working that out.

You could use the size attribute and set a minimum size:

SamWiseOwl_0-1723210275489.png

Or on the Invoked Custom Function step before expanding the rows remove the error rows:

SamWiseOwl_1-1723210379199.png

 

What do you think the solution should have been? Removing the errored tables before it was combined?

Sounds to me like you solved it, mark yourself as solution!


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

View solution in original post

3 REPLIES 3
SamWiseOwl
Super User
Super User

Hi @IanDavies 

Well done for working that out.

You could use the size attribute and set a minimum size:

SamWiseOwl_0-1723210275489.png

Or on the Invoked Custom Function step before expanding the rows remove the error rows:

SamWiseOwl_1-1723210379199.png

 

What do you think the solution should have been? Removing the errored tables before it was combined?

Sounds to me like you solved it, mark yourself as solution!


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

SamWiseOwl
Super User
Super User

Hi @IanDavies 

Before you do this add columns step can you change the column [Name] and [DNSHostName] to TEXT.

This will let you sort, filter etc as the nulls will be convereted to blanks.

Beware when using the preview values at the top of the column, they are only based on the first 999 rows of data.

 

You could also add a Replace value step before doing your test:

SamWiseOwl_0-1723200757978.png

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Sam,

 

Thanks for the suggestions, Ive made some mental notes about the column formats, I hadnt spotted that and will update the table. Unfortunately on this occasion neither of your seuggestions worked. Even after changing the column types, I still got the error and I added a replace step but again I still got the error.

 

Knowing that this worked the last time the data was updated, I rolled back to the last known good state.

 

This table brings in all files in a folder using

= Folder.Files("filepath")

 

Having rolled back to a known good state, I introduced this weeks files one at a time. I found the one that caused the issue and established that it was empty. If there is a way in Power Query to manage an idiot putting an empty CSV files into the folder, please do let me know.

 

Thanks for responding and for pointing out the typing mismatch. I don't think its appropriate to mark it as a solution because it didn't work albeit another good trouble shooting step along the way.

 

 

 

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.