cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sethwallin
Helper I
Helper I

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, @sethwallin 

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, @sethwallin 

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

(-‸ლ)

 

Thank you.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors