Forum Discussion
Anonymous
7 years agoNot applicable
partial month calculation
year month amount year month amount 2017 1 1000 2017 1 1000 2017 2 3000 2017 2 2000 2017 3 7000 wanted result-> 2017 3 4000 2017 ...
- 7 years ago
Hi Anonymous,
Maybe you could try to modify the formula as below:
Column = VAR a = 'Table1'[month] - 1 RETURN [amount] - CALCULATE ( SUM ( Table1[amount] ), FILTER ( 'Table1', 'Table1'[month] = a && 'Table1'[year] = EARLIER ( Table1[year] ) && 'Table1'[code] = EARLIER ( Table1[code] ) && 'Table1'[company] = "dk" ) )Regards,
Daniel He
v-danhe-msft
7 years agoMicrosoft Employee
Hi Anonymous,
Based on my test, you could refer to below calculated column:
Column = var a='Table1'[month]-1
return -(CALCULATE(SUM(Table1[amount]),FILTER('Table1','Table1'[month]=a&&'Table1'[year]=EARLIER(Table1[year])))-[amount])
Result:
You could also download the pbix file to have a view.
Regards,
Daniel He