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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
CoolArsh
Regular Visitor

DAX Rolling total with Measure

Here is my Query 

EVALUATE
SUMMARIZE (
    MoveTable,
    MoveTable[MonthYear],
    MoveTable[MontherCounter]
    "Moves" , SUM(MoveTable[NoOfMoves]),
    "Rolling12Month" , CALCULATE(    
                    SUM(MoveTable[NoOfMoves),
                    FILTER(       MoveTable,
                                  MoveTable[MontherCounter] >= (MoveTable[MontherCounter] - 11
                               && MoveTable[MontherCounter] <= MoveTable[MontherCounter]  
                        )                        
                )
)

 

Here is the result and as you can see the Rolling12Month is not adding the last 12 months. What am I missing???

Rolloing.jpg

 

 

 

 

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @CoolArsh,

 

Try the formula below.

 

Table =
SUMMARIZE (
    MoveTable,
    MoveTable[MonthYear],
    MoveTable[MontherCounter],
    "Moves", SUM ( MoveTable[Moves] ),
    "Rolling12Month", CALCULATE (
        SUM ( MoveTable[Moves] ),
        FILTER (
            ALL ( MoveTable ),
            'MoveTable'[MontherCounter]
                >= MAX ( 'MoveTable'[MontherCounter] ) - 12
                && 'MoveTable'[MontherCounter] <= MAX ( 'MoveTable'[MontherCounter] )
        )
    )
)

Here is the output.

 

rolling12.PNG

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
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

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @CoolArsh,

 

Try the formula below.

 

Table =
SUMMARIZE (
    MoveTable,
    MoveTable[MonthYear],
    MoveTable[MontherCounter],
    "Moves", SUM ( MoveTable[Moves] ),
    "Rolling12Month", CALCULATE (
        SUM ( MoveTable[Moves] ),
        FILTER (
            ALL ( MoveTable ),
            'MoveTable'[MontherCounter]
                >= MAX ( 'MoveTable'[MontherCounter] ) - 12
                && 'MoveTable'[MontherCounter] <= MAX ( 'MoveTable'[MontherCounter] )
        )
    )
)

Here is the output.

 

rolling12.PNG

 

Best Regards,

Cherry

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

Hi @v-piga-msft I ran into an issue with this, the moment I introduce Region to this dataset its no more doing rolling total for 12 months per region. Please take a look at the the below picture.

 

Rolloing111111.jpg

 

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.