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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Expression.Error: We cannot apply indexing to the type Function

I'm loading a billing report into Power BI and if the deposit date has an asterix (*) on the end we need to replace the [CLT PAID NET] with a 0. (Don't ask me why, something to do with the billing software that produces the report, outside of my purview.)

 

[CLT PAID NET] is Int64.type

[CSH DEPTDT] is type text

 

#"Replace Deps" = Table.ReplaceValue(#"Removed Columns3", each [CLT PAID NET], each if Text.Contains([CSH DEPDT], "*") then 0 else [CLT PAID NET],Replacer.ReplaceValue{"CLT PAID NET"})

The code above (which the Advanced Editor says has "No syntax errors") produces this error message:

 

Capture.PNG

 

Any help is much appreciated!!

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

HI, @Anonymous 

You just lack "," in your code: Replacer.ReplaceValue {"CLT PAID NET"}

#"Replace Deps" = Table.ReplaceValue(#"Removed Columns3", each [CLT PAID NET], each if Text.Contains([CSH DEPTDT], "*") 
then 0 else [CLT PAID NET],Replacer.ReplaceValue,{"CLT PAID NET"})

Result:

1.JPG2.JPG

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

HI, @Anonymous 

You just lack "," in your code: Replacer.ReplaceValue {"CLT PAID NET"}

#"Replace Deps" = Table.ReplaceValue(#"Removed Columns3", each [CLT PAID NET], each if Text.Contains([CSH DEPTDT], "*") 
then 0 else [CLT PAID NET],Replacer.ReplaceValue,{"CLT PAID NET"})

Result:

1.JPG2.JPG

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

(-‸ლ)

 

Thank you.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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