cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jbw015 Frequent Visitor
Frequent Visitor

Running Total Dax Function

Hey guys,

 

I'm newish to Power BI and I'm trying to get a running totla function for the last 12 weeks or so (length of time is less important). I have this DAX function for a measure and it returned what I want except it also tacks on the last two months of data in my dataset for some reason, and it just repeats the same cummulative value (49308 everyday for two months). If you guys could take a look at it and tell me what you think the issue is that would be great.

 

Running Total =
CALCULATE(
    SUM(Sheet2[Sales]),
FILTER (
        ALL( Sheet2 ),
        MAX ( Sheet2[Date] ) <= Today()
            && Sheet2[Date].[Date] <= MAX ( Sheet2[Date].[Date] )),
    DATESINPERIOD (
        Sheet2[Date],
        Today(),
        -84,
        DAY
    )
)

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: Running Total Dax Function

There is a Quick Measure for Running Totals. You will want a separate Calendar table to use those. I also have a Running Weeks Quick Measure here:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Weeks/m-p/391694


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

1 REPLY 1
Super User IV
Super User IV

Re: Running Total Dax Function

There is a Quick Measure for Running Totals. You will want a separate Calendar table to use those. I also have a Running Weeks Quick Measure here:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Weeks/m-p/391694


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors