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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Dave1mo1
Helper III
Helper III

Year Over Year Change in Moving Average

Hi,

 

I have a measure below that calculates the % change in a moving average, comparing the current year to the previous year. I have it on a map visual to show it by state, but it only works correctly if I have a visual-level filter for yesterday's date on the visual (our data is only current through yesterday).

 

How can I rewrite this measure to only show results for THE MOST RECENT date in my date table, which is also the date for my most recent transaction?

 

Booked - YoY Unit MA =
calculate(
divide (
[Booked - Unit MA], [Booked - PY Unit MA], 0)
-
1)
2 REPLIES 2
Anonymous
Not applicable

Hi @Dave1mo1 ,

Based on the description, try to use the following dax formula.

Booked - YoY Unit MA =
CALCULATE(
    DIVIDE(
        [Booked - Unit MA],
        [Booked - PY Unit MA],
        0
    ) - 1,
    LASTDATE('DateTable'[Date])
)

LASTDATE function (DAX) - DAX | Microsoft Learn

 

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

SachinNandanwar
Super User
Super User

VAR MostRecentDate = MAX('Table'[Date])

and then filter inside the CALCULATE for MostRecentDate



Regards,
Sachin
Check out my Blog

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.