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

Running total by mont restarting every year

Hi

 

I've calculated a running total of the views for a report. I used this dax measure

 

Running total =
CALCULATE (
    [Total views],
    FILTER (
        ALL ( testCalender ),
        testCalender[Date] <= MAX ( testCalender[Date] )
    )
)

 

This gives me a running total

 

Knipsel.JPG

 

But I need the total to stop at 31 dec 2023 and to restart on january 1 2024.

 

Thx for having a look at my question!

1 ACCEPTED SOLUTION
v-weiyan1-msft
Community Support
Community Support

Hi @jochendecraene ,nice method!

And you can also consider using the following code to create a Measure.
My Sample:

vweiyan1msft_0-1705903799634.png

 

Running total = SUMX(FILTER( ALL('Table'), 'Table'[Date] <= MAX ( 'Table'[Date] ) 
                             && YEAR ('Table'[Date]) = YEAR (MAX ('Table'[Date]))),
                     [Total View]
                    )

 

Result is as below.

vweiyan1msft_1-1705903883766.png

 

Best Regards,
Yulia Yan

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

4 REPLIES 4
v-weiyan1-msft
Community Support
Community Support

Hi @jochendecraene ,nice method!

And you can also consider using the following code to create a Measure.
My Sample:

vweiyan1msft_0-1705903799634.png

 

Running total = SUMX(FILTER( ALL('Table'), 'Table'[Date] <= MAX ( 'Table'[Date] ) 
                             && YEAR ('Table'[Date]) = YEAR (MAX ('Table'[Date]))),
                     [Total View]
                    )

 

Result is as below.

vweiyan1msft_1-1705903883766.png

 

Best Regards,
Yulia Yan

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

bhanu_gautam
Super User
Super User

@jochendecraene , Please find similar explanantion

Solved: Running Total per month restarting every year - Microsoft Fabric Community

Please accepta as solution if it helps




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






that is not working in my scenario 

 

Knipsel.JPG

It works fine when I use the datavalue in the view fact table, and don't use the related calender table.

 

Knipsel.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.

Users online (3,020)