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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
scoparr
New Member

Substituir células vazias com valores de outra tabela

Possuo um problema no qual necessito preencher os valores vazios da coluna fruta na tabela A com os valores de fruta na tabela B usando como referência o ID. Nesse caso , necessito de uma solução na espécie de procv, sem criar outra tabela ou coluna. Exemplo:

Tabela A:

IDFruta
1Melancia
2 
3Banana
4 
5Melão

Tabela B

IDFruta
2Melão
4Laranja

 

O que quero: Tabela A

1Melancia
2Melão
3Banana
4Laranja
5Melão
2 ACCEPTED SOLUTIONS
mahoneypat
Employee
Employee

You could do it with a merge in the query editor, but given your sample data it would be simpler/faster to use append.  Append one table to the other in the query editor (pick Append Queries on the Home tab), and then Filter the Fruta column to remove blank rows.

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

v-eachen-msft
Community Support
Community Support

Hi @scoparr ,

 

You could use "Replace" function, it don't need to create extra columns.

= Table.ReplaceValue(#"Changed Type"," ",each (let a = [ID] in Table.SelectRows(#"Table B", each [ID] = a)){0}[Fruta],Replacer.ReplaceText,{"Fruta"})

Here is my test file for your reference.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @scoparr ,

 

You could use "Replace" function, it don't need to create extra columns.

= Table.ReplaceValue(#"Changed Type"," ",each (let a = [ID] in Table.SelectRows(#"Table B", each [ID] = a)){0}[Fruta],Replacer.ReplaceText,{"Fruta"})

Here is my test file for your reference.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
mahoneypat
Employee
Employee

You could do it with a merge in the query editor, but given your sample data it would be simpler/faster to use append.  Append one table to the other in the query editor (pick Append Queries on the Home tab), and then Filter the Fruta column to remove blank rows.

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors