Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I've been asked to present the percentage difference in the rolling averages of Products Shipped vs Products Forecasted.
I need to be able to show by Product, and within the provided 2 year time frame, the percent differences at 3 month rolling, 6 month rolling, 9 month.....and ending at 24 month, and all instances of are to be shown.
So far I've only been able to come up with six seperate DAX measures, one for each rolling month instance.
One would think that there should be a better way.
Below is an example of 3 month rolling average % difference measure I am using. For each instance I have been changing the name and the NumOfMonths amount.
3 Mo. Produc Rolling Avg % Diff =
VAR NumOfMonths = -3
VAR LastCurrentDate = MAX('Dates'[Date])
VAR Period = DATESINPERIOD('Dates'[Date], LastCurrentDate, NumOfMonths, MONTH)
VAR FC_RollingAvg =
CALCULATE(
AVERAGEX(
VALUES('Dates'[Month & Year]),
COALESCE([Product FC Total], 0)
),
Period
)
VAR Sales_RollingAvg =
CALCULATE(
AVERAGEX(
VALUES('Dates'[Month & Year]),
COALESCE('Orders Taken Measures'[Orders Taken], 0)
),
Period
)
VAR FirstDateInPeriod = MINX(Period, 'Dates'[Date])
VAR LastDateWithSales = MAX('BOI Orders Taken'[DATE_CREATED])
RETURN
IF(
FirstDateInPeriod <= LastDateWithSales,
DIVIDE(Sales_RollingAvg - FC_RollingAvg, FC_RollingAvg, 0)
)
Solved! Go to Solution.
You could try creating a parameter table with values 3, 6, 9, ... 24. Add this field to your visual and define the variable NumOfMonths as SELECTEDVALUE ( ParameterTable[Number of Months] ).
Proud to be a Super User!
Man you just saved me a heap of time. Thank you!
Glad to hear that!
Proud to be a Super User!
Man you just saved me a heap of time. Thank you!
Glad to hear that!
Proud to be a Super User!
You could try creating a parameter table with values 3, 6, 9, ... 24. Add this field to your visual and define the variable NumOfMonths as SELECTEDVALUE ( ParameterTable[Number of Months] ).
Proud to be a Super User!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
65 | |
64 | |
56 | |
39 | |
27 |
User | Count |
---|---|
85 | |
59 | |
45 | |
43 | |
38 |