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.
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!
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