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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jochendecraene
Helper IV
Helper IV

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.