Forum Discussion
Create calculated column in Calendar table from range of dates in lookup table.
Hi saffronbows ,
Please try like:
(x) => Table.SelectRows(Lookup,each x[Date] >= [BEGIN_DATE] and x[Date] < [Lead.BEGIN_DATE])[YRTR]
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Thank you, Gao. Only a single value should be returned from the lookup table. When I try to expand the list I get "Expression.Error: A cyclic reference was encountered during evaluation." Am I interpreting your syntax correctly? From the query editor, my step looks like "= Table.AddColumn(#"Previous Step", "YRTR", each (Table.SelectRows('Lookup', each 'Calendar'[Date] >= [BEGIN_DATE] and 'Calendar'[Date] < [Lead.BEGIN_DATE])[YRTR]))"