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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
David_Marks
Frequent Visitor

creating moving measure of the last 12 months without accumulating.

I need a measure that returns me the last 12 months of my base, but without accumulating. For example, if the base have 16 months, it only returns the last 12 months. it would be another moving measure always bringing the last 12 months. But if in my base have just 5 months will bring me just 5 months and when i have 12 months or more, it will bring me 12 months always 12 last months.

1 ACCEPTED SOLUTION
David_Marks
Frequent Visitor

i created this measure and it worked for me i'm posting here to help other people with the same problem, but thank you for all the help.

CALCULATE(
    [Valor Consumo],
    DATESINPERIOD(
        dData[Data],
        LASTDATE(dData[Data]),
        -12,
        MONTH),
    VALUES(dData[Nome do Mês])
)

View solution in original post

2 REPLIES 2
David_Marks
Frequent Visitor

i created this measure and it worked for me i'm posting here to help other people with the same problem, but thank you for all the help.

CALCULATE(
    [Valor Consumo],
    DATESINPERIOD(
        dData[Data],
        LASTDATE(dData[Data]),
        -12,
        MONTH),
    VALUES(dData[Nome do Mês])
)
amitchandak
Super User
Super User

@David_Marks , Based on what I got,

First, create a measure

Avg 1 = averageX(Values('Date'[Month Year]), calculate(SUM(Sales[Sales Amount])))

 

then try

Cumm Sales = CALCULATE([Avg 1],filter(allselected(date),date[date] <=max(date[Date])))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.