【发布时间】:2021-08-09 06:50:25
【问题描述】:
我有两张桌子。 id 和用户 id 列之间存在关系。我想在用户表中添加一个计算列,其中包含用户的第一笔交易,发票类型为“A”。
当我使用:
Calculate(min(Transaction[transaction date])) 它工作正常,但我需要过滤发票类型。当我使用Calculate(min(Transaction[transaction date]),Filter(Transaction,Invoice type="A")) 时,我只得到 2021-02-01 并且不动产。
实现这一目标最有效的方法是什么?
用户表:
| ID | Name |
|---|---|
| 1 | John Smith |
| 2 | Alan Walker |
交易表:
| user id | transaction date | Invoice type |
|---|---|---|
| 1 | 2021-02-01 | A |
| 1 | 2021-02-25 | A |
| 1 | 2021-02-25 | B |
| 2 | 2021-03-05 | A |
| 2 | 2021-01-23 | B |
【问题讨论】: