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
captainlaw
Employee
Employee

Merge Issue | Replace NULL

Hello Power BI Community,

 

I'm trying to merge two table in Power BI queries, and I used full-outer join.  As you can from the result screenshot below, It didn't quite merge the two, so I tried to add a Custom Column trying to replace null values from the other column.  Below is the syntax I used - Text.Replace([State],null,[State.1])

 

I'm receiving error that null cannot be convert to text. 

I'm wondering how best to merge the two or what syntax I should use to replace all null? 

 

 

Appreciate your help.

 

powerbi-merge.JPG

1 ACCEPTED SOLUTION

It wasn't an issue with Cap Letters nor JOIN nor Merge.  When I simply Merge again with FULL JOIN, it finally worked.  I am also able to create a DimState from the merged table with combination of IF and Table.Distinct() 

Issue resolved.  Thank you all.

View solution in original post

4 REPLIES 4
v-caliao-msft
Employee
Employee

Hi @captainlaw,

 

In Power BI Desktop, there are multiple options available when using Merge Query feature.

 

To remove the null value, you can use inner join instead.

Capture.PNG

 

Reference
https://businessintelligist.com/2015/09/15/power-bi-desktop-merge-query-options/

 

Regards,

Charlie Liao

It wasn't an issue with Cap Letters nor JOIN nor Merge.  When I simply Merge again with FULL JOIN, it finally worked.  I am also able to create a DimState from the merged table with combination of IF and Table.Distinct() 

Issue resolved.  Thank you all.

CahabaData
Memorable Member
Memorable Member

I would suggest if the record set model is a reasonable record count and not gigantor: Append (not merge) 1 column to the other for a single long column.  Then create a column using DISTINCT or VALUEs so to eliminate all duplicates.

 

 

www.CahabaData.com
kcantor
Community Champion
Community Champion

You aren't getting a clean merge because your data is not an exact match. Some are in All Caps. Clean the data and transform to make them match, then Merge again. You can also replace the null before creating a new column. Replace null, for example, with 1 the use that in your column instead of null.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.