Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi All,
I'm looking to create custom time period so I can compare the last 12 months of sales from this month (as today is in Nov 2021, I would want Nov 2020 - Oct 2021) to the previous 12 months prior to that (Nov 2019 - Oct 2020).
I would like this to update dynamically when the data is refreshed each month.
Thanks in advance!
Solved! Go to Solution.
Hi @Anonymous ,
According to your description, here’s my solution.
1.Create a calendar table.
2.Rank the table by month.
RANK = RANKX('Table 2',[YearMonth],,DESC,Dense)
3.Create relationship of the two tables.
4.Create three measure.
Last 12 months sales = CALCULATE(SUM('Table'[Sales]),'Table 2'[RANK]IN{2,3,4,5,6,7,8,9,10,11,12,13})
Previous 12 months sales = CALCULATE(SUM('Table'[Sales]),'Table 2'[RANK]IN{14,15,16,17,18,19,20,21,22,23,24,25})
Compare = DIVIDE([Last 12 months sales],[Previous 12 months sales])
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
According to your description, here’s my solution.
1.Create a calendar table.
2.Rank the table by month.
RANK = RANKX('Table 2',[YearMonth],,DESC,Dense)
3.Create relationship of the two tables.
4.Create three measure.
Last 12 months sales = CALCULATE(SUM('Table'[Sales]),'Table 2'[RANK]IN{2,3,4,5,6,7,8,9,10,11,12,13})
Previous 12 months sales = CALCULATE(SUM('Table'[Sales]),'Table 2'[RANK]IN{14,15,16,17,18,19,20,21,22,23,24,25})
Compare = DIVIDE([Last 12 months sales],[Previous 12 months sales])
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 104 | |
| 81 | |
| 66 | |
| 50 | |
| 45 |