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
AnkitKukreja
Super User
Super User

M Query Error

Hi,

 

I'm currently facing an error which states
"Expression.Error: We cannot apply field access to the type Function.
Details: Value=[Function] Key=P_Beneficiary_Name".

 

I'm using the below in custom column, when I write the below code I see no error, but when I save this and check in my table the column shows error and the error message is the above line that I've shared. Please 

if ( Text.StartsWith [P_Beneficiary_Name] = "CLIX CAPITAL" and Text.Contains [Program_Type] = "Pre Approved" ) then ([Gross_LOAN_AMOUNT] - [P_Amount_Disbursed] ) else [Gross_LOAN_AMOUNT]

 

Thanks,

Ankit

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904
1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @AnkitKukreja 

It should be

 

 

if ( Text.StartsWith( [P_Beneficiary_Name] , "CLIX CAPITAL") and Text.Contains( [Program_Type] , "Pre Approved" )) then ([Gross_LOAN_AMOUNT] - [P_Amount_Disbursed] ) else [Gross_LOAN_AMOUNT])

 

 

Phil 


If I answered your question please mark my post as the solution.

If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

1 REPLY 1
PhilipTreacy
Super User
Super User

Hi @AnkitKukreja 

It should be

 

 

if ( Text.StartsWith( [P_Beneficiary_Name] , "CLIX CAPITAL") and Text.Contains( [Program_Type] , "Pre Approved" )) then ([Gross_LOAN_AMOUNT] - [P_Amount_Disbursed] ) else [Gross_LOAN_AMOUNT])

 

 

Phil 


If I answered your question please mark my post as the solution.

If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


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