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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mloc1990
Helper I
Helper I

Running total that restarts after a number of days based off a measure

Hi,

 

Im pretty new to power BI and DAX, I have the running total calculated using the formula below for accounts:

Running Total = CALCULATE(SUM(uwtest[volume]),FILTER(ALL(uwtest),'uwtest'[authdate]<=MAX(uwtest[authdate])),VALUES(Accounts[accountname]))
 
I have a measure of days that varies depending on the account and I'm trying to calculate it where it will restart the running total for accounts when a certain number of days have been reached.
 
E.g an account has 133 days and every 133 days the running total will restart.
 
Thanks for the help!
2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @mloc1990 

The best way is that add a group column for date column (uwtest[authdate] )

Then add a conditional in the measure

Running Total = CALCULATE(SUM(uwtest[volume]),FILTER(ALL(uwtest),'uwtest'[authdate]<=MAX(uwtest[authdate]) && 'uwtest'[group] = MAX('uwtest'[group])),VALUES(Accounts[accountname]))

 

Best Regards,

Lin

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

Hi @v-lili6-msft 

 

It's definitely along the lines of what I am needing but when I add the group column I can only select a predefined period that will be the same for all accounts. In the attached images is it possible to do the same setup using a measure I have created called "Medium Days" as each account has a different amount of days for running total.

 

Thanks!

 

 

Running Total Medium Days.PNGGroup Column.PNG

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.