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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Community,
I have to create measure for calculating a rolling 12 months for Sales. I don't have date column but i have month colum(like 1,2,3 ..12) . How can i acheive it.
Please help.
Thanks,
Paruchuri
Solved! Go to Solution.
Do you also have a year column?
No
Then i don't think that's possible
I have brought Year column and now i have concatenated Year and month column and created calculated column. Now i have the column like 201801.
How can i get the rolling 12 months.
Hi @Anonymous
You may have a look at below posts. Sample data and expected output will be helpful to provide an accurate solution.
https://community.powerbi.com/t5/Desktop/Moving-Average-for-Prev-6-Next-6-Months/td-p/171712
https://community.powerbi.com/t5/Desktop/Averages-For-The-Last-12-Months/td-p/324289
https://www.sqlbi.com/articles/rolling-12-months-average-in-dax/
Regards,
Cherie
It doesn't helps me out.
If you have Year and month, you can use the function 'DATE'
Hi @Anonymous
You may try with below measure. Attached the sample file. If it is not your case, please share some sample data.
Measure =
CALCULATE (
SUM ( Data[Sales] ),
FILTER (
ALL ( 'Data' ),
'Data'[YearMonth]
>= MAX ( Data[YearMonth] ) - 11
&& 'Data'[YearMonth] <= MAX ( 'Data'[YearMonth] )
)
)
Regards,
Cherie
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |