Forum Discussion
mt_729
2 years agoRegular Visitor
Create a table based on two values with increments in Power Query
Hello, I'm trying to create a dynamic table which will receive an input for minimum and maximum targets. The query should then add rows with 0.1 increments. What I find difficult is that a colum...
- 2 years ago
hello, mt_729
let Source = your_table, gen = List.Generate( () => [Target = Source{[Type = "Minimum"]}[Target], Payout = Source{[Type = "Minimum"]}[Payout]], (x) => x[Target] <= Source{[Type = "Maximum"]}[Target], (x) => [Target = x[Target] + .001, Payout = List.Min({Source{[Type = "Maximum"]}[Payout], x[Payout] + .015})] ), z = Table.FromRecords(gen) in z
AlienSx
2 years agoSuper User
hello, mt_729
let
Source = your_table,
gen = List.Generate(
() => [Target = Source{[Type = "Minimum"]}[Target], Payout = Source{[Type = "Minimum"]}[Payout]],
(x) => x[Target] <= Source{[Type = "Maximum"]}[Target],
(x) => [Target = x[Target] + .001, Payout = List.Min({Source{[Type = "Maximum"]}[Payout], x[Payout] + .015})]
),
z = Table.FromRecords(gen)
in
z