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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
james_b
Regular Visitor

Getting the average value from YTD dax value for the Last 12 months

Hi all,

 

I am trying to calculate the rolling 12m average derived from monthly YTD Dax measure value; I have so far miserably failed to calculate this so far!

 

For instance, with simple data in excel. With L12m AVG as the target

james_b_0-1671097254723.png

The YTD DAX measure is a simple calculate dates YTD with date table...

This must be achievable in DAX (I do not want to make a running total column in Power Query as v slow), as the graph can calculate the average line!

james_b_1-1671097484732.png

Any help greatly appreciated!
James

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @james_b 

 

You could try this measure

L12M Avg = 
AVERAGEX (
    CALCULATETABLE (
        DATESINPERIOD ( 'Date'[Date], MAX ( 'Date'[Date] ), -1, YEAR )
    ),
    [YTD DAX]
)

vjingzhang_0-1671174646043.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!

Hi,

Unfortunately the solution is not correct as per the BI Model. See image below

james_b_0-1671197932372.png

Thanks,

James

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.