【发布时间】:2020-05-03 20:09:33
【问题描述】:
我试图在同一张表中获取当前日期和 7(或 X)天前的金额。
我有这个 PowerBI 矩阵 (TransactionDate, Amount),我需要将行日期减去 10 天的金额相加。
见下例
TransactionDate Amount Amount_TransactionDateMinus7
01/10 100 25 -- this is the amount for 1/3
01/11 150 33 -- this is the amount for 1/4
01/12 200 50
...
01/17 500 100 -- this ties to 1/10 date
为简单起见,我们假设数据源只是一个只有这两个字段的视图。 数据来源:
TrxDate Amount
1/3 20
1/3 5
...many rows
1/10 60
1/10 40
...
如何计算 Amount_TransactionDateMinus7 字段?我怀疑这涉及使用行上下文,但似乎无法让它工作。
【问题讨论】:
标签: dax powerbi-desktop