We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 32 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 66 | |
| 66 | |
| 40 | |
| 34 | |
| 25 |