Forum Discussion
Isildur13
2 years agoFrequent Visitor
Calculate total on each row based on year
Hi Community I need help with calculating the total amount for the whole year and display it on the rows in my table. I have no date table since the data only includes a year column. I have t...
- 2 years ago
try this :
$ Total Amount last Year =var last_year = max( period[year]) - 1CALCULATE ([$ Amount],all( table_name),period([year]) = last_year)If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. Dont forget to hit that thumbs up button 🫡👍
Isildur13
2 years agoFrequent Visitor
Hi Daniel29195
It worked!
I went with the second solution and added one more values field.
I have one more question:
Is it possible to add another measure where the totals just calculated is shown like a last year? So the total amount year for category A 2020 367.75 would be displayed on category A 2021 instead?
Daniel29195
Community Champion
2 years agotry this :
$ Total Amount last Year =
var last_year = max( period[year]) - 1
CALCULATE (
[$ Amount],
all( table_name),
period([year]) = last_year
)
If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. Dont forget to hit that thumbs up button 🫡👍