📈 Power BI DAX: 12-Month & 6-Month Rolling Sales 📊
Rolling totals are key for trend analysis. In Power BI, you can calculate 12-month and 6-month rolling sales using DAX and a proper date table.
🔁 What is a Rolling Total?
A rolling (or moving) total adds up values over a specific trailing period — like the last 6 or 12 months.
📆 Prerequisites
✅ A proper Date table marked as a date table
✅ Your Sales table must have a valid date field
🧮 DAX for 12-Month Rolling Sales
🧮 DAX for 6-Month Rolling Sales
📊 Example Use Case
Use these measures in a line chart to visualize rolling trends. X-axis = 'Date'[Month]
, Y-axis = Rolling 12M Sales
or Rolling 6M Sales
.
📷 Image suggestion: Line chart comparing 6M vs 12M rolling sales over time.
✅ Best Practices
🧠 Always use a continuous date axis
⚙️ Use CALCULATE
+ DATESINPERIOD
for flexibility
📉 Great for detecting seasonal trends and growth patterns
Comments
Post a Comment