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

Expression.Error: We cannot apply field access to the type Function.

Hi, Can someone help on this error 

Expression.Error: We cannot apply field access to the type Function.
Details:
Value=[Function]
Key=Reference

 

Below is from advanced Editor

let
Source = Excel.Workbook(File.Contents("C:\Users\RNoori\OneDrive - Schlumberger\Business Insight\FP28 PBI Project\Realized-Unrealized\XR222.xlsx"), null, true),
XR222_Sheet = Source{[Item="XR222",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(XR222_Sheet, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"BaseAmount", type number}, {"AccountingPeriod", type text}, {"FiscalYear", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Date2", each [AccountingPeriod]&"/1/"&[FiscalYear]),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Date2", type date}}),
#"Added Custom1" = Table.AddColumn(#"Changed Type1", "EOMONTH", each Date.EndOfMonth([Date2])),
#"Changed Type2" = Table.TransformColumnTypes(#"Added Custom1",{{"EOMONTH", type date}, {"System", type text}, {"Description", type text}, {"Reference", type text}}),
#"Added Custom2" = Table.AddColumn(#"Changed Type2", "Correct Curr", each if [System]="GL" then
Text.Start([Description],3) else
[CurrencyCode]),
#"Changed Type3" = Table.TransformColumnTypes(#"Added Custom2",{{"Reference", type text}}),
#"Added Custom3" = Table.AddColumn(#"Changed Type3", "Reference2", each if Text.Length[Reference] = 9 and
Text.StartsWith[Reference] ="FX"

then
Text.End([Reference],7)
else [Reference]),
Reference2 = #"Added Custom3"{0}[Reference2]
in
Reference2

 

Appreciate it. 

3 REPLIES 3
ritanoori
Resolver I
Resolver I

I fixed it. It was syntax error.

if Text.Length([Reference]) = 9 and
Text.StartsWith([Reference], "FX")

then
Text.End([Reference],7)
else [Reference]

Thanks for posting the solutions. Kudos to you.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

@ritanoori , have you added any new formula? , if yes share that

Is there a column which showing error as the data value, if yes, what is the column name

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.

Top Solution Authors
Top Kudoed Authors