Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
60 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |