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
dilipprasad
Frequent Visitor

Custome Colum cannot convert a value of type List to type Text.

Hi,

I am new to Power BI and I am trying to add a custom column and the details are as below. I am getting an error as below, kindly help me here.

Expression.Error: We cannot convert a value of type List to type Text.
Details:
Value=[List]
Type=[Type]

 

Custom_ExpectedFulfilmentTime
= Table.AddColumn(#"Removed Columns", "Custom", each if(#"Actionable Demands"[Service Line Input] = null)
then #"Actionable Demands"[#"Allocation ETA/DOJ"]

else if(Text.Contains(#"Actionable Demands"[Service Line Input] , "internal", Comparer.OrdinalIgnoreCase))
then Date.ToText(Date.From(DateTime.LocalNow()),"MM/dd/yyyy")

else if(Text.Contains(#"Actionable Demands"[Service Line Input] , "extension", Comparer.OrdinalIgnoreCase))
then Date.ToText(Date.From(DateTime.LocalNow()),"MM/dd/yyyy")
else "TBD")

1 ACCEPTED SOLUTION
bcdobbs
Super User
Super User

Hi,

 

A few things:

  • Your if statements are referring to #"Actionable Demands". That is a precious step which is a list of values. If needs a column which looks like [ColumnName].
  • the syntax for if doesn't use brackets in power query. It should just be:

if condition then output else output



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

2 REPLIES 2
dilipprasad
Frequent Visitor

Thank you i have removed #"Actionable Demands" as you said

bcdobbs
Super User
Super User

Hi,

 

A few things:

  • Your if statements are referring to #"Actionable Demands". That is a precious step which is a list of values. If needs a column which looks like [ColumnName].
  • the syntax for if doesn't use brackets in power query. It should just be:

if condition then output else output



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

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.