Forum Discussion
Calculate Total for the Current Year
- Anonymous5 years ago
Hi lancea
You can create measures to return Overall Year Total and Average Year Total .
Monthly total = CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Date Description]))
Overall Year Total = CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Date Year]))
Average Year Total = [Overall Year Total]/CALCULATE(DISTINCTCOUNT('Table'[Date Description]),ALLEXCEPT('Table','Table'[Date Year]))
Then put the measures with fields ‘Date Description’ and ‘Date Year’ in a new table visual ,like this
In ‘Date Year’ filter , filter out data for 2020 .
I have attached my pbix file , you can refer to it .
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lancea , Try measures like, with help from date table
This year Today =
var _min = today()
return
CALCULATE(sum('Table'[Sales]), FILTER('Date','Date'[Date] = year(today()) ) )
overall This year Today =
var _min = today()
return
CALCULATE(sum('Table'[Sales]), FILTER(ALL('Date'),'Date'[Date] = year(today()) ) )
overall avg This year Today =
var _min = today()
return
CALCULATE(Avergae('Table'[Sales]), FILTER(ALL('Date'),'Date'[Date] = year(today()) ) )
Thank you for this! The Overall Year Total works! However, I am getting incorrect result from the average as seen in the screenshot below: