我有一个表,按月和年恢复应用程序列表,如下所示:
Table 1
App | Month | Year
A | 1 | 2019
B | 1 | 2019
C | 1 | 2019
D | 1 | 2019
E | 1 | 2019
...
etc
我有一个表,其中包含该公司所有票证的信息,包括应用程序以及月份和年份,如下所示:
Table 2
IDTicket | App | Month | Year
44424 | B | 1 | 2019
44425 | D | 1 | 2019
44426 | B | 1 | 2019
44427 | A | 1 | 2019
44428 | E | 1 | 2019
...
etc
我需要在表1中添加一列,该列根据每个应用程序(月份和年份)对表2的票数进行计数,如下所示:
Table1
App | Month | Year | CountOfTickets
A | 1 | 2019 | 1
B | 1 | 2019 | 2
C | 1 | 2019 | 0
D | 1 | 2019 | 1
E | 1 | 2019 | 1
答案 0 :(得分:0)
尝试这样的事情:
CountOfTickets =
CALCULATE (
COUNT ( Table2[IDTicket] ),
Table2[App] = EARLIER ( Table1[App] ),
Table2[Month] = EARLIER ( Table1[Month] ),
Table2[Year] = EARLIER ( Table1[Year] )
)