我在 Power BI 中手动(硬编码)制作了一个包含 2 行的表格,这是我的起始值:
现在我想扩展该表的行数,但我希望下一个值为:1.3% - (1.3% * 5%) = 1.24% 此外,我希望该行之后的行包含值:1.24% - (1.24% * 5%) = 1.17% 等等。
有人知道如何在 Power BI 中执行此操作吗?
提前致谢!
powerquery 中的一种方法是自引用函数
let process = (xx as list) as list =>
let calculation = List.Last(xx)/100-(List.First(xx)/100*List.Last(xx)/100),
// adjust .0001 in next row to limit output
check = if calculation <.0001 then xx & {calculation*100} else @process (xx & {calculation*100})
in check,
Source=process({5,1.3}),
Output = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in Output