Forum Discussion
custom function creates but expression error when add column/invoke custom function getting
- 7 years ago
Hello, Thank you for your offer to help. Chris Webb from Cross Join was able to help me. I'll include the solution below for others to benefit from.
The correct and successful function is as follows -
let Fiscalyr1 = (UpgradeRpDate,CurrentMaint,UpgradeCost) => if Date.IsInCurrentYear(Date.Year(UpgradeRpDate))=Date.Year(UpgradeRpDate) then
CurrentMaint+UpgradeCost
else CurrentMaint
in Fiscalyr1
I was using square brackets incorrectly in the original one. You use square brackets when you’re calling the function because you’re getting values from the various columns on the current row. Inside the function, however, you’re working with function parameters and not columns on a row in a table.
This is now a solved issue. thanks again for reaching out to help!
HI mcraven1845,
You can upload to onedrive or google drive and share link here. If your data are from external datasource, you can copy part of your records to excel sheet and pack it with your pbix file for share.
Regards,
Xiaoxin Sheng
Hello, Thank you for your offer to help. Chris Webb from Cross Join was able to help me. I'll include the solution below for others to benefit from.
The correct and successful function is as follows -
let Fiscalyr1 = (UpgradeRpDate,CurrentMaint,UpgradeCost) => if Date.IsInCurrentYear(Date.Year(UpgradeRpDate))=Date.Year(UpgradeRpDate) then
CurrentMaint+UpgradeCost
else CurrentMaint
in Fiscalyr1
I was using square brackets incorrectly in the original one. You use square brackets when you’re calling the function because you’re getting values from the various columns on the current row. Inside the function, however, you’re working with function parameters and not columns on a row in a table.
This is now a solved issue. thanks again for reaching out to help!