Forum Discussion
Increase amount on every row
Maybe there is a easy way to add this measure. I've been trying to increase the amount on every row from 2020 onwards (every amount will be added to the previous result). I've been trying different measures but cannot get the right results.
The result I've been looking for would be something like this table:
| Date | - Amount | - Calc amount |
| 01-01-2019 | - 1000 | 1000 |
| 02-01-2019 | - 2000 | 2000 |
| 01-01-2020 | - 1000 | 1000 |
| 02-01-2020 | - 2000 | 3000 |
| 03-02-2020 | - 2000 | 5000 |
- Anonymous5 years ago
Hi Anonymous ,
Based on your description, you can create a measure as follows.
calculated_measure =
var x1=CALCULATE(
SUM('Table1'[- Amount]),
FILTER(ALL('Table1'),'Table1'[Date].[Year]=2020&&'Table1'[Date]<=MAX('Table1'[Date])))
return
IF(MAXX('Table1','Table1'[Date].[Year])=2020,x1,MAX('Table1'[- Amount]))Result:
Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- BA_Pete
Super User
Hi Anonymous ,
You can add a column in Power Query with this code:
if Date.Year([Date]) >= 2020 then [Amount] + 1000 else [Amount]Pete
- AnonymousNot applicable
Hi Anonymous ,
Based on your description, you can create a measure as follows.
calculated_measure =
var x1=CALCULATE(
SUM('Table1'[- Amount]),
FILTER(ALL('Table1'),'Table1'[Date].[Year]=2020&&'Table1'[Date]<=MAX('Table1'[Date])))
return
IF(MAXX('Table1','Table1'[Date].[Year])=2020,x1,MAX('Table1'[- Amount]))Result:
Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Thanks for the help, this measure helped