This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
i generated quick measure for "rolling 12 months average sales" however it is not matching with actual measure. please see below pbix file
https://drive.google.com/file/d/1zuTSZE_dw6qJ5CcNi4MdDOH-EdEsEIwO/view?usp=drive_link
Solved! Go to Solution.
Hi @powerbiexpert22 -The main difference in auto generated quick measure, it is using the DATESBETWEEN with DATEADD to get a 12-month range but adds an extra month (ENDOFMONTH(DATEADD(__LAST_DATE, 1, MONTH))) where as in custom measure Uses DATEPERIOD function to get a 12-month range directly. one more difference found at the aggregation that is calculated at quick measure,it uses averagex with a summarized table, which might include additional months and hence affect the result where as in custom measure it uses the sums the sales amount and then divides by 12 to get the average.
Once quick measure generated for rolling average, you can modify to use Dateperiod function and avoid adding the extra month.
Modified quick measure:
Sales rolling average =
IF(
ISFILTERED('DateDim'[Date]),
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
VAR __LAST_DATE = ENDOFMONTH(MAX('DateDim'[Date]))
VAR __DATE_PERIOD =
DATESINPERIOD(
'DateDim'[Date],
__LAST_DATE,
-12,
MONTH
)
RETURN
CALCULATE(
SUM(SalesFact[amount]),
__DATE_PERIOD
) / 12
)
Hope it gives you the same result like custom measure
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Hi,
I think you will get the correct answer with this measure
Measure = AVERAGEX(SUMMARIZE(CALCULATETABLE(DateDim,DATESBETWEEN(DateDim[Date],EDATE(MIN(DateDim[Date]),-11),MAX(DateDim[Date]))),DateDim[Year],DateDim[Month],"A",[Sales]),[A])
Hope this helps.
Hi @powerbiexpert22 -The main difference in auto generated quick measure, it is using the DATESBETWEEN with DATEADD to get a 12-month range but adds an extra month (ENDOFMONTH(DATEADD(__LAST_DATE, 1, MONTH))) where as in custom measure Uses DATEPERIOD function to get a 12-month range directly. one more difference found at the aggregation that is calculated at quick measure,it uses averagex with a summarized table, which might include additional months and hence affect the result where as in custom measure it uses the sums the sales amount and then divides by 12 to get the average.
Once quick measure generated for rolling average, you can modify to use Dateperiod function and avoid adding the extra month.
Modified quick measure:
Sales rolling average =
IF(
ISFILTERED('DateDim'[Date]),
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
VAR __LAST_DATE = ENDOFMONTH(MAX('DateDim'[Date]))
VAR __DATE_PERIOD =
DATESINPERIOD(
'DateDim'[Date],
__LAST_DATE,
-12,
MONTH
)
RETURN
CALCULATE(
SUM(SalesFact[amount]),
__DATE_PERIOD
) / 12
)
Hope it gives you the same result like custom measure
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 37 | |
| 28 | |
| 28 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 38 | |
| 32 | |
| 28 | |
| 24 |