Forum Discussion
How to avoid multiple measures for different categories
Hi JCdata1992
Take a look at functions such as PARALLELPERIOD or DATEADD.
Then you will only need to create two measures. For example, imagine you want to compute sales: one for the total sales and another for the previous year CALCULATE(total sales, PARALLELPERIOD( [Dates],-1,YEAR).
In this way, when you apply context, you will obtain what you need
Thanks for your answer. However, i.e, I want to sum and work with the total cost by each category (I have 9 cost category) by year (I have 9 years; 2015-2023). The idea is to work with those totals and then with the results, calculate the variation year by year and represents the % contribution of its amount respect the total amount in the same year. I want to know if there is a simple way instead of creating a variety of measures of each one