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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Colton_J
Frequent Visitor

"List" turning into "[List]", creating errors. Help!

I've got a rather large report and one of the operations require that I iterate through a list and check if the value is in another column, in another table. So basically I'm adding a column and for each row's list pass it into a function check if any of those list values are in this other table. I've taken that other table's column and buffered the list to speed things up, but the biggest issues I'm finding are with the List.Contains method. When using that, the column with the lists I'm checking somehow get turned into a text form or something. They go from yellow text saying "List" to black text saying "[List]" and then in that new column I only get errors that say: "We can't convert "[List]" to type List. What is weird, is that if I run this query by itself in its own query it works fine, also when I first implemented it into the large report it worked as well, but then the next day it did this whole error thing when nothing was changed. Any ideas why this might be happening or possible fixes? Thanks!

4 REPLIES 4
ImkeF
Community Champion
Community Champion

This is very hard to determine just from the text you wrote. Could you please create some sample data that shows the behaviour?

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Ok, so lets say I have column1 with each row containing a list of numbers.

 

Column1

List

List

List

 

And I have my function which is like:

myFunc = (theList as list) as number =>

let

    //code...

    newList = List.Transform(theList, each if List.Contains(bufferedList, _ ) then 0 else 1),

    //more code...

in

    out,

 

So, when I do:

NewColumn =  Table.AddColumn(#"Prev Table", "NewColumn", each myFunc([Column1])),

 

In the smaller report, each item in NewColumn is a number and all the lists in Column1 stay lists. 

But, in the large report, it is as if the List types are turning into text and losing all data that was contained within that list.

So when you run that step, in Column1, "List" turns into "[List]" on each row, and in NewColumn, all items are Errors that say "Cannot turn type "[List]" into type List"

 

What is kind of weird though, is that on some computers it works, and sometimes on the computers where it works, it will stop working at some time.

ImkeF
Community Champion
Community Champion

Looks like a bug to me.

 

What else you can do is: Add a column with "Value.Is([Column1], type list)", filter on FALSE and examine the findings.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Yeah, Value.Is revealed nothing, they are all indeed lists... Must be a bug

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors