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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
monojchakrab
Resolver III
Resolver III

Error with M code

Hey All,

 

I was watching this great lesson , "

Power BI Dev Camp March Intro to M Programming",

and at around the 29th minute of the video, the presenter shared a code for user-defined types as below :

 

 

let
CustomerRecordType = type [FirstName=text, LastName=text],
CustomerTableType = type table customerRecordType,
CustomersTable=
 #table (CustomerTableType,{
      {"Matt", "Masson" },
      {"chris", "webb" },
      {"Reza", "Rad" },
      {"Chuck", "sterilicious"}
       
}
)	   
in
CustomersTable

 

But when I am running the code in PQ, verbatim as shared, I get the following error :

 

monojchakrab_0-1652591696257.png

Any idea why I am getting this error instead of the table and shown in the output in the lesson? Am I missing something?

 

Thanks and really appreciate the help.

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

PQ is super sensitive to case. This line has customerRecordType which should have been CustomerRecordType (i.e. small case c should be replaced with C).

CustomerTableType = type table customerRecordType

 Hence, if your change it to following, then this would work

CustomerTableType = type table CustomerRecordType

 

View solution in original post

2 REPLIES 2
Vijay_A_Verma
Super User
Super User

PQ is super sensitive to case. This line has customerRecordType which should have been CustomerRecordType (i.e. small case c should be replaced with C).

CustomerTableType = type table customerRecordType

 Hence, if your change it to following, then this would work

CustomerTableType = type table CustomerRecordType

 

That was a life-saver @Vijay_A_Verma 

 

Thanks for the leg-up.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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