If statement DAX运行带有IF语句的总日历日期问题

If statement DAX运行带有IF语句的总日历日期问题,if-statement,powerbi,dax,cumulative-sum,If Statement,Powerbi,Dax,Cumulative Sum,我有一个简单的if语句来计算日期的值 IF statement = IF(AND(MAX('Calendar'[Date]) > [Last date], SUM('Calendar'[Value1]) > COUNT('Value2'[Value2])), [diff_e_2], IF(AND(MAX('Calendar'[Date]) > [Last date], SUM('Calendar'[Value1]) < COUNT('Value2'[Value2]))

我有一个简单的if语句来计算日期的值

IF statement = 
IF(AND(MAX('Calendar'[Date]) > [Last date], SUM('Calendar'[Value1]) > COUNT('Value2'[Value2])), [diff_e_2],
 IF(AND(MAX('Calendar'[Date]) > [Last date], SUM('Calendar'[Value1]) < COUNT('Value2'[Value2])), [diff_t_2],
  IF(MAX('Calendar'[Date]) < [Last date], [diff_t_2],
     IF(MAX('Calendar'[Date]) = [Last date], [diff_e_2](), 
[diff_e_2])
)))
IF语句=
如果(和(最大('Calendar'[Date])>[Last Date],总和('Calendar'[Value1])>计数('Value2'[Value2]),[diff_e_2],
如果(和(最大('Calendar'[Date])>[Last Date],总和('Calendar'[Value1])
[最后日期]=今天()+10

这是工作良好,我可以得到我想要的图形。但当我创建一个运行/累计总计时,它在日期[最后日期]不起作用

Running total = 
CALCULATE(([IF statement]), FILTER(ALLSELECTED('Calendar'), 'Calendar'[Date]<=MAX('Calendar'[Date])))
运行总数=

CALCULATE([IF语句])、FILTER(ALLSELECTED('Calendar')、'Calendar'[Date]您的运行总计公式非常不正确,假设您的IF语句返回值而不是字符串,则公式更正应该有效,否则您正试图计算字符串,这将导致测量错误:

Running total = 
CALCULATE(([IF statement]), FILTER(ALLSELECTED('Calendar'), 'Calendar'[Date]<=MAX('Calendar'[Date])))
运行总数=
计算([IF语句])、筛选(全部选定('Calendar')、'Calendar'[日期]
Running total = 
CALCULATE(sum([IF statement]), FILTER(ALL('Calendar'), 'Calendar'[Date]<=MAX('Calendar'[Date])))