Forum Discussion
jeffreyweir
Helper III
8 years agoGenerate a list from data stored in two columns
Hi folks. I'm trying to 'expand' a Table by creating a new column that for each record contains all the numbers between TP_Start and TP_End. Here's what I've got currently: I know that...
- 8 years ago
Ahh...I see now that I was trying to shoot a mosquito with a cannon, to quote MarcelBeug
#"Added Custom" = Table.AddColumn(#"Expanded TimePeriod", "TradingPeriod", each {[TP_Start]..[TP_End]}),
Ashish_Mathur
Super User
8 years agoHi,
Try this M code instead
={Number.From([TP_Start])..Number.From([TP_End])}
- francisco_marco3 years agoFrequent Visitor
It works perfectly. If the columns are already a number is even simpler: {[TP_Start]..[TP_End]}
- Ashish_Mathur3 years ago
Super User
Glad to know that.
- jeffreyweir8 years ago
Helper III
Ahh...I see now that I was trying to shoot a mosquito with a cannon, to quote MarcelBeug
#"Added Custom" = Table.AddColumn(#"Expanded TimePeriod", "TradingPeriod", each {[TP_Start]..[TP_End]}),