Forum Discussion
Need Help Turning my Custom Column into a Custom Function
- 4 years ago
I think you need more input variables for your function.
Try this:
(D as date, KPI as text, Col as text ) as number => let Lookup = Record.Field( Table.SelectRows(sedKPI, (sedKPI) => (sedKPI[ValidFrom] <= D) and (sedKPI[ValidTo] >= D) and (sedKPI[KPI] = KPI) ){0}, Col ) in LookupYou can call the function like this:
I've updated and attached the pbix that v-yanjiang-msft provided in the prior thread in case you want to take a closer look.
Unfortunately your solution doesn't work for me.
[date] references to the date field in the table I am trying to run the function in.
the Values I wan't to add dynamicaly are KPI for the name of the KPI the function has to search for, and [green] to select the column where the value is stored (green, yellow,....)
Also shouldn't the start of the function be (KPI)=> as that is the Variable I try to call later in the function?
I need to see your pbix file to see the solution you are working on to give right advice. Ideal will be to upload the file without confidential/sensitive data to a cloud storage service such as Onedrive/Google Drive/Dropbox/Box (Onedrive preferred) and share the link here.
- ChromeMystic4 years agoHelper I
I wasn't in the office since you last posted, so I only got around to create the mockup today.
https://1drv.ms/u/s!AqDYC-h9nk9olv9B3Fd1VhSDcAso6Q?e=T2HmtY
As you see I am creating a lookup table. And the two Variables I would like to use in a function are the name of the KPI and the Column it has to look for (if thats no possible, i can write different functions for the different columns).
The date value is taken from the date column in sedKPIDate and conpared to the validFrom and validTo values in sedKPI
Thanks a ton for your help!
- v-yanjiang-msft4 years agoCommunity Support
Hi ChromeMystic ,
Have you read AlexisOlson 's solution, if it still not be resolved, could you please explain more or show your expected result.
Best Regards,
Community Support Team _ kalyj- ChromeMystic4 years agoHelper I
Actually I didn't 🙂 Thanks for the headsup