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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Rck7
Helper II
Helper II

How to calculate Running totals for a constant value/month?

Hi friends,

I would like your suggestion on calculating running totals for a given value/ month. 

Currently, I am calculating running totals for expected usage/month (i.e. 75000/month). 

I am trying to calculate running expected totals for my data in the data table(Oct-14 to Oct-17) where I came up with the below measure:

 

Expected Total = COUNTROWS (
SUMMARIZE (Records, Records[Date].[Year], Records[Date].[Month]))*75000 ,  which is giving me running total as 75000*37 months =2775000 (i.e. from27-Oct-14 to 26-Oct-17).

Instead I want my measure to calculate the expected running totals as 75000*36 months = 270000. 


How would I be able to modify my measure to calculate running toatals for 36 months? 

Kindly help!!!

Thank you. 

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Rck7,

 

This could be a trick. The intervals from 27-Oct-14 to 26-Oct-17 are 36 months. But the records of month are 37 when you used COUNTROWS. Because October is counted one time more.

 

For example, from 2016-01-27 to 2017-01-26. There are 12 months intervals but 13 months of records. 2016-01 to 2016-12 and 2017-01. 

 

It seems you don't need concern the context. Maybe you can minus 1 directly. Or use function DATEDIFF instead.

DateDiff =
DATEDIFF ( DATE ( 2014, 10, 27 ), DATE ( 2017, 10, 26 ), MONTH )

How to calculate Running totals for a constant value month.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

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

Hi,

 

Your qestion is not clear.  Share the link from where i can downlooad your file and also show your expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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