Forum Discussion
Anonymous
6 years agoNot applicable
Measure Not Returning Prior Year Results
Hello all,
I'm trying to get the count of orders for a previous year. I have the answer via filters, but I'm trying to get it in a measure as part of a larger calculation. However, the below function does not seem to be filtering the data and is instead returning the results of all the years. Anyone know why?
Count of Orders in the Previous Year = CALCULATE([Multi Origin Order Count], Filter(FactTable, YEAR(today())-1))
Thanks!
- Anonymous6 years ago
You can try:
Count of Orders in the Previous Year = CALCULATE([Multi Origin Order Count], Filter(FactTable, [Datecolumn] = YEAR(today())-1))
If its a datatimecolumn use YEAR([datecolumn]) ofcourse.
2 Replies
- AnonymousNot applicable
You can try:
Count of Orders in the Previous Year = CALCULATE([Multi Origin Order Count], Filter(FactTable, [Datecolumn] = YEAR(today())-1))
If its a datatimecolumn use YEAR([datecolumn]) ofcourse.- AnonymousNot applicable
I swapped the filtering of the fact table to filter the date dim table and that worked per your solution.
Count of Orders in the Previous Year = CALCULATE([Multi Origin Order Count], FILTER(DimDate, DimDate[Year] = YEAR(TODAY())-1))Thanks!