Forum Discussion
Anonymous
5 years agoNot applicable
Filter amounts by year
Hello Community, I have a sample dataset given below, where, I want to filter by year and calculate the total amount for each id for current year and past year. ImpYear ReportedDate Id ...
- 5 years ago
Hi Anonymous ,
There is option to create disconnected table.
Example: create new table which will have values 2017, 2018, 2019. This table must not have any connection to existing table where you have measures.
In slicer use Year from this new disconnected table.
Now create these 2 measures:Current Year =var _currentYear = SELECTEDVALUE('Year'[Year])RETURN CALCULATE(SUM('Table'[Amount]),FILTER('Table','Table'[ImpYear]=_currentYear))Past Year =var _previousYear = SELECTEDVALUE('Year'[Year])-1RETURN CALCULATE(SUM('Table'[Amount]),FILTER('Table','Table'[ImpYear]=_previousYear))Regards,
Nemanja Andic
wdx223_Daniel
Community Champion
5 years ago
Anonymous
5 years agoNot applicable
Hello wdx223_Daniel The above measure that you have created is Past Year Total. How would I calculate Current Year Total?
- wdx223_Daniel5 years ago
Community Champion
sum(table[amount]