Forum Discussion
Sum Accummulate with 2 columns
- 9 years ago
Hi sebasjun,
For your result, the cumulated measure is still not sure based on my understanding. For the following example, 54805107<60963705, it shoud be running total.
You can create a calculated column using the formula, transfer the month text type to number type.New-Month=SWITCH([Month], "January", 1,"February",2, "March", 3, "April", 4, "May", 5, "June",6, "July",7, "August", 8 , "September", 9 , "October", 10,"November",11, "December", 12, 0 )Then create a measure using the formula.
Acumulated = CALCULATE(sum(Query1[Total_USD]);FILTER(ALLEXCEPT(Query1,Query1[A_Codi]);Query1[New-Month]<max(Query1[New-Month])))
I test it using my sample table below, it works fine.
Create a measure:Acumulated = CALCULATE(SUM('FACT'[REVENUE]),FILTER(ALLEXCEPT('FACT','FACT'[ID]),'FACT'[Month]<=MAX('FACT'[Month])))
Please see the result shown in the following screenshot.
Best Regards,
Angelia
Hi sebasjun,
For your result, the cumulated measure is still not sure based on my understanding. For the following example, 54805107<60963705, it shoud be running total.
You can create a calculated column using the formula, transfer the month text type to number type.
New-Month=SWITCH([Month], "January", 1,"February",2, "March", 3, "April", 4,
"May", 5, "June",6, "July",7, "August", 8 ,
"September", 9 , "October", 10,"November",11, "December",
12, 0 )
Then create a measure using the formula.
Acumulated = CALCULATE(sum(Query1[Total_USD]);FILTER(ALLEXCEPT(Query1,Query1[A_Codi]);Query1[New-Month]<max(Query1[New-Month])))
I test it using my sample table below, it works fine.
Create a measure:
Acumulated = CALCULATE(SUM('FACT'[REVENUE]),FILTER(ALLEXCEPT('FACT','FACT'[ID]),'FACT'[Month]<=MAX('FACT'[Month])))
Please see the result shown in the following screenshot.
Best Regards,
Angelia
Thanks this is the problem.
Best regards!!