cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aharris15 Frequent Visitor
Frequent Visitor

Filling null cells from a different column

I'm new to Power Query and PowerBI and feel like this should be relatively simple but I haen't figured it out quite yet.

 

I have an incomplete column of data that has some null cells. I want to fill the null cells in Column A with the values in Column B, but only the null cells. If the cells in Column A have a value, I want to keep those values. And furthermore, if Column B happens to be null as well, how do you get it to get the value from Column C?

 

Update: I've tried setting up a conditional column as shown below but I don't think its recognizing the null values because it just returns the column I have setup in the Else condition and I still have the nulls.

 

PowerBI Capture.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
gpoggi Regular Visitor
Regular Visitor

Re: Filling null cells from a different column

Yep, you are using space " " and blank doesn't have spaces, so try to compare to nothing between quotes "" it should work.

 

Any question, just let me know.

 

Regards,

 

Gian Carlo Poggi

View solution in original post

4 REPLIES 4
gpoggi Regular Visitor
Regular Visitor

Re: Filling null cells from a different column

Hi aharris15, your conditional column setup seems to be ok, and other way to get the Columns C value when Column B is null is creating a Custom Column with this code:

if

  [Column A] = null

then

  if

    [Column B] = null

  then

    [Column C]

  else

    [Column B]

else

  [Column A]


This should work, but one question regarding your conditional column, it should work as it is, so maybe the problem is about your nulls, did you confirm that Column A contains nulls instead of (blank) values? if you did, Could you send a sample of your data so we can help you to figure it out what is going on?

 

Regards,

 

Gian Carlo Poggi

aharris15 Frequent Visitor
Frequent Visitor

Re: Filling null cells from a different column

So my cells are actually blank - they do not have null in them. I tried putting " " instead of null but still no luck. Is there something else I need to put there instead?

gpoggi Regular Visitor
Regular Visitor

Re: Filling null cells from a different column

Yep, you are using space " " and blank doesn't have spaces, so try to compare to nothing between quotes "" it should work.

 

Any question, just let me know.

 

Regards,

 

Gian Carlo Poggi

View solution in original post

aharris15 Frequent Visitor
Frequent Visitor

Re: Filling null cells from a different column

I was able to get that to work. Thank you!

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Top Kudoed Authors
Users Online
Currently online: 57 members 1,378 guests
Please welcome our newest community members: