Forum Discussion
Monthly comparison over years
Hello v-kkf-msft ,
Thank you for your reply. How and where do you insert the ROLLING X MEASURE in this matrix table?
Hi Oros ,
I simply add the measure and Sales to the Values field of the matrix, and I switch the value to rows in the attribute for easier comparison.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Oros4 years ago
Post Prodigy
Hello v-kkf-msft ,
Thank you for your reply. I just realized that your solution if ROLLING X MONTHS. What I was looking for was simply to start the month-to-month comparison from NOVEMBER 2021 to NOVEMBER 2022, instead of January-January. Is there a way to show each month starting November 2021? Thanks again.
- v-kkf-msft4 years ago
Community Support
Hi Oros ,
I am not sure if I understood your question correctly. If you only need to compare data in the range 2021-11 to 2022-11, please try
Rolling x months = VAR x = 3 VAR diff = CALCULATE ( SUM ( 'SALES TABLE'[Sales] ), DATESINPERIOD ( 'DATE TABLE'[Date], MAX ( 'DATE TABLE'[Date] ), -1 * x, MONTH ) ) VAR SelectDate = FORMAT ( MAX ( 'DATE TABLE'[Date] ), "yyyymm" ) RETURN IF ( SelectDate >= "202111" && SelectDate <= "202211", diff )Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.