第一次发帖,但我的智慧结束了。
我有一个大约有8,000行的工作簿,但是它被几个包含嵌套条件语句的字段所困扰。 (sumifs,averageifs,countifs)因此,尝试迁移到PowerPivot,但没有使用PowerPivot的经验。在
找到类似的SUMIFS转换和
但是嵌套功能似乎让我感到沮丧。花了一天的前半天,到目前为止,这是我所拥有的最好的。请救我自己。谢谢!
IFERROR(
IF([Savings_TYPE]="[E]",
IF(OR([Savings_DATE]<NOW()-30,
Calculate(Sum([Realized Savings]),ALL(PMO_TEST_View_1,[Project_ID_FK],[Savings_DATE]>0)),
Calculate(Sum([Realized Savings]),ALL(PMO_TEST_View_1,[Project_ID_FK],[Savings_DATE]))),
IF(OR([Current_Status]="complete",
[Current_Status]="Cancelled",
[Current_Status]="on hold",
[Current_Status]="delete"),0,
IF(AND(
IFERROR(
Calculate(average([Realized Savings]),[Project_ID_FK],[Savings_DATE]>=NOW()-100,[Savings_DATE]<NOW())=0,0),
Calculate(COUNTROWS(([Discounted Savings]),Filter(PMO_TEST_View_1,[Discounted Savings]=EARLIER([Project_ID_FK]&&[Savings_DATE]>=NOW()-100,[Savings_DATE]<NOW())>1),0,
MIN([Discounted Savings],
IFERROR(Calculate(average([Realized Savings],ALL([Project_ID_FK],[Savings_DATE]>=NOW()-100,[Savings_DATE]<NOW(),[Realized Savings]<>0)),1000000000))))),0),0)
以下内容已在Excel中有效。
=IFERROR(
IF([@[Savings_TYPE]]="[E]",
IF(OR([@[Savings_DATE]]<NOW()-30,
SUMIFS([Realized Savings],[Project_ID_FK],[@[Project_ID_FK]],[Savings_DATE],[@[Savings_DATE]])>0),
SUMIFS([Realized Savings],[Project_ID_FK],[@[Project_ID_FK]],[Savings_DATE],[@[Savings_DATE]]),
IF(OR([@[Current_Status]]="complete",
[@[Current_Status]]="Cancelled",
[@[Current_Status]]="on hold",
[@[Current_Status]]="delete"),0,
IF(AND(
IFERROR(AVERAGEIFS([Realized Savings],[Project_ID_FK],[@[Project_ID_FK]],[Savings_DATE],">="&NOW()-100,[Savings_DATE],"<"&NOW())=0,0),
COUNTIFS([Discounted Savings],">0",[Project_ID_FK],[@[Project_ID_FK]],[Savings_DATE],">="&NOW()-100,[Savings_DATE],"<"&NOW())>1),
0,MIN([@[Discounted Savings]],
IFERROR(AVERAGEIFS([Realized Savings],[Project_ID_FK],[@[Project_ID_FK]],[Savings_DATE],">="&NOW()-100,[Savings_DATE],"<"&NOW(),[Realized Savings],"<>0"),1000000000))))),0),0)