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
Sam02
Frequent Visitor

Getting 12 Months Running Total

Hello all,

need to create a measure that would return 12 month running total for each month like in screenshot below.

 
1 ACCEPTED SOLUTION

Hi @Sam02 

Create a measure

Measure =
CALCULATE (
    SUM ( 'Fact'[Value] ),
    FILTER (
        ALLSELECTED ( 'Fact' ),
        'Fact'[related date] <= MAX ( 'Fact'[related date] )
            && DATEDIFF ( 'Fact'[related date], MAX ( 'Fact'[related date] ), MONTH ) <= 12
    )
)

Capture14.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Greg_Deckler
Community Champion
Community Champion

There is a Running Total quick measure. Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks for your reply Greg, the quick measure did not worked and I created another one my self using different option both gave me same incorrect result.

 
Quick Measure =
CALCULATE(
    [Sum of value],
    FILTER(
        ALLSELECTED('Period'[Period]),
        ISONORAFTER('Period'[Period], MAX('Period'[Period]), DESC)
    )
)
 
Using my Dax
Running Total =
CALCULATE([Sum of value],DATESBETWEEN(Period[FirstDayOfMonth],MINX(ALL(Period),Period[FirstDayOfMonth]),MAX(Period[FirstDayO
 
Sam02
Frequent Visitor

following measure gives me Running total for continious period of time, Can some one help me to modify it for getting running total upto last 12 months only?

 

Running Total =
CALCULATE([Sum of value],
FILTER(ALL(Period),Period[FirstDayOfMonth] <= MAX (Period[FirstDayOfMonth])),
VALUES(Period[FirstDayOfMonth].[Year]),
VALUES(Period[FirstDayOfMonth].[Month])
)

 

 

 

 

 

 
 

Hi @Sam02 

Create a measure

Measure =
CALCULATE (
    SUM ( 'Fact'[Value] ),
    FILTER (
        ALLSELECTED ( 'Fact' ),
        'Fact'[related date] <= MAX ( 'Fact'[related date] )
            && DATEDIFF ( 'Fact'[related date], MAX ( 'Fact'[related date] ), MONTH ) <= 12
    )
)

Capture14.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-juanli-msft 

 

Hi Meggie, I was wondering if it is possible so the values for 2019 only and mabke it blank to others years in the past?

I need to get one line chart start at 2019 like in Screenshot below.

 

TIA,

Sam

Line.JPG

Hi @Sam02 

How about this?

Measure =
IF(YEAR(MAX('Fact'[related date]))=YEAR(Today()),
CALCULATE (
    SUM ( 'Fact'[Value] ),
    FILTER (
        ALLSELECTED ( 'Fact' ),
        'Fact'[related date] <= MAX ( 'Fact'[related date] )
            && DATEDIFF ( 'Fact'[related date], MAX ( 'Fact'[related date] ), MONTH ) <= 12
    )
))

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks a lot Maggie! That worked fine.

Sam02
Frequent Visitor

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.

Top Solution Authors
Top Kudoed Authors