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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Dicken
Helper III
Helper III

M code Custom functions dealing with lists

  
hi, I have had this problem a few times and don't really understand it, 

If I  define an custom list; ; 

  let alist = {"a acc a", "abc def", "abc dd dda", "abc a bc" } in alist

 

  and then a custom funciton ; 

( listA, valueA )=> 
    List.Contains( listA, valueA, ( x ,y )=> 
   Text.Contains( x, y ) )

 

i can invoke that on the list   so ;    Source = function;  Source (Alist, "a") - = true , 


but if I want to use the custom function dialog box that is generated I cannot refer to the list,  it is not recognesed, 
I have to convert to a table , then  define the  list parameter as a list , I can then select the table / table column to use as a list? 
this seems a very odd so 

let alist = {"a acc a", "abc def", "abc dd dda", "abc a bc" } in 
Table.FromList( alist, Splitter.SplitByNothing(), {"A"} )

(  listA as list , valueA as text  )=> 
    List.Contains( listA, valueA, ( x ,y )=> 
   Text.Contains( x, y ) )

 

Can anyone explain why I cant' just refer to the list  directly  ?  or suggest other ways around this problem? 

Richars

1 ACCEPTED SOLUTION
PwerQueryKees
Resolver III
Resolver III

Just an ommision in the UI. If it is important to you, have a search. I recall something similar passing here, but can't find it myself... It can be worked around, but some effort is involved...

View solution in original post

2 REPLIES 2
Dicken
Helper III
Helper III

Thanks I just wondered if  overlooking somthing obvoious, thanks for taking the time to resond. 

PwerQueryKees
Resolver III
Resolver III

Just an ommision in the UI. If it is important to you, have a search. I recall something similar passing here, but can't find it myself... It can be worked around, but some effort is involved...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors