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
trevb
Resolver I
Resolver I

Passing the current Record to a function

I created a function that I wanted to use to do a calculation when a custom column is being created.

 

I defined the function something like...

 

(Source as record, CheckVal as number) =>

 

When I try to use the function I am passing in the underscore but the function gives an error of "We cannot convert the value null to type Record" which suggests that _ is null.

 

Any thoughts on what I am doing wrong or an example of how to make this work?

 

Many thanks,

 

Trevor

 

2 REPLIES 2
arify
Microsoft Employee
Microsoft Employee

Where do you pass that "_"? For example, is it in Table.SelectRows(table, each func(_, checkVal)) ? Can you put the whole M code here?

v-caliao-msft
Microsoft Employee
Microsoft Employee

Hi Trevb,

 

What's do you mean by "create a function"? So far as I know, there is no an place where we can create a function. So in your scenario, please elaborate your issue, if possible provide us some screenshots, so that we can make further analysis.

 

Regards,

Charlie Liao

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.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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