Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MMB920
Frequent Visitor

fill in future months null values with previous 3 months averages

Hello,

 

am looking to fill in future null values with last 3 months averages using DAX measure.

 

Tried the power query solution but it appears complicated to apply. Please see below data sample screenshot for illustration.

 

NULLs are captured for June data onward:

 

MMB920_0-1685732181586.png

Thanks,

M

3 REPLIES 3
some_bih
Super User
Super User

Hi @MMB920 I understand that you want to see rolling average. If yes, then please create two measure and in Date table create Year month column like 

"Year month", FORMAT ( [Date], "YYYY-MM" 

1. Simple sum, M_supp_hrs = suM(Sheet14[support_hrs])

2. 

Sup Rolling Average 3 Month =
CALCULATE (
    AVERAGEX ( VALUES ( 'Date'[Year month]), [M_supp_hrs] ),
    DATESINPERIOD ( 'Date'[Date], MAX ( 'Date'[Date] ), -3, MONTH )
)
 
This newly created column should be used to see rolling average. I hope this help
Please how average calculation treat zero amount and how this affect your expected results.
 
some_bih_0-1686041000702.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






some_bih
Super User
Super User

Hi @MMB920 please provide sample data with expected output for example





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Hello,

 

Here is a data sample (below) of what am trying to accomplish in PBI DAX (Column 4).

 

TeamMonthsupport_hrsForecasted (support_hrs)
TEAM A1/1/20226.17Actual
TEAM A2/1/202235.65Actual
TEAM A3/1/202226.2Actual
TEAM A4/1/202212.05Actual
TEAM A5/1/202232.22Actual
TEAM A6/1/202278.57Actual
TEAM A7/1/202230.75Actual
TEAM A8/1/202263.81Actual
TEAM A9/1/20228.63Actual
TEAM A10/1/202244.14Actual
TEAM A11/1/202272.14Actual
TEAM A12/1/202242.43Actual
TEAM A1/1/202328.66Actual
TEAM A2/1/202337.55Actual
TEAM A3/1/202351.69Actual
TEAM A4/1/202359.22Actual
TEAM A5/1/202336.59Actual
TEAM A6/1/202320.25Actual
TEAM A7/1/20230= Ave of(June, May, Apr)
TEAM A8/1/20230= Ave of (Jul,Jun,May)
TEAM A9/1/20230= Ave of (Aug, Jul,Jun)
TEAM A10/1/20230= Ave of (Spe, Aug, Jul)
TEAM A11/1/20230= Ave of (Oct, Sep, Aug)
TEAM A12/1/20230= Ave of (Nov, Oct, Sep)

 

Please let me know if you need other details.

 

Thanks,

MMB

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.