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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
yc-bsa
Regular Visitor

Help please - if null replace with data from another column

Hi All, 

I am trying to adding a new column basically combining the data from the first two columns (marked A & B in the image). 

If column A has a A, new column = A. 

Or if column A is null, new column = B. 

I tried to use 'add column' and 'add conditioned column' and both came back with the same result - new column is only picking up value from column A but not column B. 

Can someone please help and tell me what I have done wrong?? 

I changed the data type after adding the new column but doesn't solve the problem. 

Thank you. 

ycbsa_0-1637299633235.png

ycbsa_1-1637299729864.png

 

 

6 REPLIES 6
V-lianl-msft
Community Support
Community Support

Hi @yc-bsa ,

 

After trying what @Gabriel_Walkman said, does the problem still exist?

If the problem persists, could you share a sample pbix after deleting sensitive data?

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi @V-lianl-msft ,

No, that doesn't solve the problem. 

I am unable to attach the file so I did another screenshot to show what the problem is if that helps to clarify my question. 

Gabriel_Walkman
Continued Contributor
Continued Contributor

I'd guess empty is not the same as N/A. Try N/A or null instead of that empty field in your conditional column.

Hi Gabriel, 

Thanks for your reply. I did try using null.type but same result (only pick up from column A)

ycbsa_0-1637307214041.png

ycbsa_1-1637307235263.png

 

 

Try "N/A" instead of Null.Type. Or replace the N/A values to null and then check for null (not Null.Type).

Hi Gabirl, 

Thanks for your help, but both null and 'N/A' are part of the data so I cannot replace them. 

Somehow I cannot attach the file so I have attached a photo of the sample data, hopefully that helps to explain better what I am trying to ask: 

- if column 'ID category' has a value, column 'Category' should equal to this value no matter what (even if it's 'N/A');

-only if column 'ID category' is null, column 'Category' should equal to 'Type Category'

 

ycbsa_0-1637814477419.png

but as you can, my formula is only picking up value from 'ID category', even if it is null, it won't picking up fom 'type category'

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.