Forum Discussion
Comparing data to a base year, calculate difference and % change
- Anonymous1 year ago
lbendlin , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement and implemented the result. Please check if there is anything that can be improved. Here is my solution:
Hi dp_75 ,I created some data:
Here are the steps you can follow:
1. Create measure.
Calc 2019 Avg = AVERAGEX( FILTER(ALL('Table'),'Table'[Year]=2019&&'Table'[Month]=MAX('Table'[Month])),[Value])Avg Value vs 2019 avg = DIVIDE( AVERAGEX('Table',[Value]),[Calc 2019 Avg])-12. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
lbendlin , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement and implemented the result. Please check if there is anything that can be improved. Here is my solution:
Hi dp_75 ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Calc 2019 Avg =
AVERAGEX(
FILTER(ALL('Table'),'Table'[Year]=2019&&'Table'[Month]=MAX('Table'[Month])),[Value])Avg Value vs 2019 avg =
DIVIDE(
AVERAGEX('Table',[Value]),[Calc 2019 Avg])-1
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- dp_751 year agoFrequent Visitor
many thanks - that solution works.
I also found this similar DAX expression works:
Avg Value 2019 = CALCULATE (AVERAGE ( 'All data'[Value] ),FILTER (ALL ( 'All data' ),'All data'[Date].[Month]= MAX ( 'All data'[Date].[Month] )&& 'All data'[Date].[Year] = 2019 ))