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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
han_rj
Helper IV
Helper IV

Issue Treating nulls in Conditional Column of Type Any

Hi All,

 

I have a column Name of which I am extracting only rows that contain words like "Additive" using conditional column , I have attached the M-Query code for the same. The issue I am facing is that Null are getting transformed as Errors.Please may I have help know where I am wrong.

han_rj_0-1739243806760.png

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Community Champion
Community Champion

if Text.Contains(Text.From([Name]??""),"Additive") then [Name] else null

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @han_rj,


Thanks @Akash_Varuna  and @wdx223_Daniel  for Addressing the issue.

 

we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Regards,
Vinay Pabbu

Akash_Varuna
Super User
Super User

Hi @han_rj , I think Text.Contains function expects a non-null value, and when it encounters a null , it throws an error Could You please try this 
Table.AddColumn(
#"Changed Type",
"Custom",
each if [Names] <> null and Text.Contains([Names], "Additive") then [Names] else null
)
If this post helped please do give a kudos and accept this as a solution
Thanks In Advance

wdx223_Daniel
Community Champion
Community Champion

if Text.Contains(Text.From([Name]??""),"Additive") then [Name] else null

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.