cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mpi_gov_vn
Frequent Visitor

What does the symbol () , =>, _ mean in M expression?

Hi guys,

 

I was reading an article on how to use List.Generate function. It mentions the symbols like "()", "=>" and "_" that I do not understand the meaning. Here's an example:

 

 

List.Generate(() => 10, each _ > 0, each _ - 1)

 

 

Could you help me explain this? Or better, is there a documentation to this? Thank you.

 

Reference: https://docs.microsoft.com/en-us/powerquery-m/list-generate

1 ACCEPTED SOLUTION
AlB
Super User III
Super User III

Hi @mpi_gov_vn 

You use ( )=> to declare (the start of) a function without input arguments in M. 

Check this out: https://docs.microsoft.com/en-us/powerquery-m/m-spec-functions

 

As for _  ,each is equivalent to

(_)=>

i.e. declaring (the start of) a function where _ is the input argument to the function

Read this excellent article to know more about each and _

https://www.excelguru.ca/blog/2018/01/09/each-keyword-power-query/

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

View solution in original post

2 REPLIES 2
AlB
Super User III
Super User III

Hi @mpi_gov_vn 

You use ( )=> to declare (the start of) a function without input arguments in M. 

Check this out: https://docs.microsoft.com/en-us/powerquery-m/m-spec-functions

 

As for _  ,each is equivalent to

(_)=>

i.e. declaring (the start of) a function where _ is the input argument to the function

Read this excellent article to know more about each and _

https://www.excelguru.ca/blog/2018/01/09/each-keyword-power-query/

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

View solution in original post

mpi_gov_vn
Frequent Visitor

Thanks @AlB , that hit the spot!

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Kudoed Authors