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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to use each expression in M Language

Hello Community, 

I am learning M language (let-in structure), and I have a question relevant to 'each' expression

The online course/video I am taking, is teaching how to use each.

190616 each Q1.jpg

I try to use the same function and coding to group up something for a try.

But the Query gives me an error like this:

190616 each Q2.jpg

Saying "Expression.Error: There is an unknown identifier. Did you use the [field] shourthand for a _[field] outside of an 'each' expression?"

 

I am using Microsoft Office 365 ProPlus, Excel Version 1905.

 

Anybody can help me on the each expression blockage?

1 ACCEPTED SOLUTION
Nolock
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

the problem is that the second parameter of Table.Group should be text instead of column identifier.

Custom1 = Table.Group(#"ChangedType", "Tasks", {"ML Test", each _})

instead of

Custom1 = Table.Group(#"ChangedType", [Tasks], {"ML Test", each _})

You can also read more about that in the PowerQuery Documentation: Table.Group

View solution in original post

2 REPLIES 2
Nolock
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

the problem is that the second parameter of Table.Group should be text instead of column identifier.

Custom1 = Table.Group(#"ChangedType", "Tasks", {"ML Test", each _})

instead of

Custom1 = Table.Group(#"ChangedType", [Tasks], {"ML Test", each _})

You can also read more about that in the PowerQuery Documentation: Table.Group

Anonymous
Not applicable

Tks sooo much @Nolock. It works now.

At first I thought it's the each key expression went wrong.

Thank you very much.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.