Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
rmartin1
Frequent Visitor

Fill in blank columns with another table

Hello,

 

I have Table1 that includes IP that I created from various import. Table2 has a unique indentifier Column name Hostname and IP. Now Table2 has Hostname with some blank IP cells that I can find in Table4. How do I fill in the blanks in Table2 If I find the Hostname containing the IP in Table1. 

 

I shorten the IP for ease.  Blank means a blank cell. (Thank You)

 

Table1

HostnameIP
Sun1231
Mars1232
Saturn123

 

 

Table2

HostnameIP
Sun123blank
Mars123blank
Saturn12blank
Venus17
1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Issue this statement where #"Changed Type" should be replaced with your previous step

Table.ReplaceValue(#"Changed Type",each [IP],each if [IP]=null or [IP]="" then try Table1{[Hostname=[Hostname]]}[IP] otherwise null else [IP],Replacer.ReplaceValue,{"IP"})

See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCi7NMzQyVtJRUorViVbyTSwqRuIGJ5aUFgHlYfyw1LzSYkMgz1wpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Hostname = _t, IP = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Hostname", type text}, {"IP", Int64.Type}}),
    Custom1 = Table.ReplaceValue(#"Changed Type",each [IP],each if [IP]=null or [IP]="" then try Table1{[Hostname=[Hostname]]}[IP] otherwise null else [IP],Replacer.ReplaceValue,{"IP"})
in
    Custom1

View solution in original post

1 REPLY 1
Vijay_A_Verma
Super User
Super User

Issue this statement where #"Changed Type" should be replaced with your previous step

Table.ReplaceValue(#"Changed Type",each [IP],each if [IP]=null or [IP]="" then try Table1{[Hostname=[Hostname]]}[IP] otherwise null else [IP],Replacer.ReplaceValue,{"IP"})

See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCi7NMzQyVtJRUorViVbyTSwqRuIGJ5aUFgHlYfyw1LzSYkMgz1wpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Hostname = _t, IP = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Hostname", type text}, {"IP", Int64.Type}}),
    Custom1 = Table.ReplaceValue(#"Changed Type",each [IP],each if [IP]=null or [IP]="" then try Table1{[Hostname=[Hostname]]}[IP] otherwise null else [IP],Replacer.ReplaceValue,{"IP"})
in
    Custom1

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors