我需要每月汇总满足以下条件的ID的金额:
日期结束<协议日期
日期结束<要显示的月份
我尝试使用filter,sum和其他选项,但结果是相同的。
我的数据是:
ID START DATE AGREEMENT DATE END DATE AMOUNT
1 09/15/2018 01/01/2019 02/20/2019 100
2 09/20/2018 01/15/2019 12/01/2019 100
3 10/01/2018 03/01/2019 12/01/2019 100
4 10/01/2018 03/20/2019 05/01/2019 100
5 11/10/2018 07/10/2019 100
6 09/15/2018 04/05/2019 05/01/2019 100
7 10/01/2018 06/10/2019 05/01/2019 100
8 10/20/2018 07/11/2019 04/10/2019 100
9 11/11/2018 08/01/2019 100
10 11/01/2018 06/01/2019 04/10/2019 100
这是我的DAX代码:
Result =
CALCULATE (
SUM ( 'Report Diario'[Amount] );
USERELATIONSHIP ( Calendario[Date]; 'Report Diario'[End Date] );
FILTER (
'Report Diario';
'Report Diario'[End Date] < 'Report Diario'[Agreement date]
)
)
答案 0 :(得分:0)
最后,我创建了一个新表,下一个计算出的列有效:
Result = CALCULATE(SUM('Report Diario'[Amount]); FILTER('Report Diario'; AND(Calendario [Date] <'Report Diario'[Agreement Date]; AND(Calendario [Date]>'Report Diario'[结束日期];否(ISBLANK('Report Diario'[结束日期]))))))))))