Forum Discussion
New Measure - Multiple sum if's
- Anonymous3 years ago
Hi AlBud
Whether you want to calculate the sum corresponding to 2011, 2010, 2015, or the sum of these three years separately, the following scenario is to calculate the corresponding sum of the corresponding quantities for these three years.
Measure = var a=SUMMARIZE(FILTER(ALLSELECTED('G_LEntries'),[G_L_Account_No] in {2010,2011,2025}),[G_L_Account_No],"Sum",CALCULATE(SUM(G_LEntries[Amount]))) return IF(SELECTEDVALUE(G_LEntries[G_L_Account_No]) in {2010,2011,2025},MAXX(FILTER(a,[G_L_Account_No]in VALUES(G_LEntries[G_L_Account_No])),[Sum]),SUM(G_LEntries[Amount]))Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi AlBud
Whether you want to calculate the sum corresponding to 2011, 2010, 2015, or the sum of these three years separately, the following scenario is to calculate the corresponding sum of the corresponding quantities for these three years.
Measure = var a=SUMMARIZE(FILTER(ALLSELECTED('G_LEntries'),[G_L_Account_No] in {2010,2011,2025}),[G_L_Account_No],"Sum",CALCULATE(SUM(G_LEntries[Amount])))
return IF(SELECTEDVALUE(G_LEntries[G_L_Account_No]) in {2010,2011,2025},MAXX(FILTER(a,[G_L_Account_No]in VALUES(G_LEntries[G_L_Account_No])),[Sum]),SUM(G_LEntries[Amount]))
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Yolo,
This works, thanks!