cancel
Showing results for 
Search instead for 
Did you mean: 
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 Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!