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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
PIYUSHPRAJAPATI
Resolver I
Resolver I

Running Total Help

PIYUSHPRAJAPATI_0-1718709451592.png

This is table visual in the powerbi i want value in 2015, 01 sum of previous three month same as it is for the 2015, 02 sum of the previous three month includes(2015,01) (2014,12) (2014,11) like wise for the next.

I have used sample finance data in the powerbi desktop and i created a Calender table using the following dax.

If anyone have idea to possible this kind of the solution or not using dax or anything in powerbi...?

Calender = CALENDAR(DATE(2013,09,01), DATE(2015,03,01))
and make a relation ship on the invoice date column of the sample data (finanace) in powerbi.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from @foodd and@rajendraongole1,please allow me to provide another insight:
Hi,@PIYUSHPRAJAPATI 
Regarding the issue you raised, my solution is as follows:

1.As for your question, our answer is that your answer is correct, in powerbi if you want to use dax to implement the first three data accumulation and so repeated, is a typical recursive problem, which is difficult to achieve in powerbi using dax.

Solved: Recursion in DAX - Microsoft Fabric Community

 

2.You can try doing the calculation in excel first and then importing it into power bi. This is by far the easiest way. Here is a link to the relevant documentation:
How to create recursive functions in Excel with LAMBDA (spreadsheetweb.com)

 

3.You can also implement this function in PowerQurey, but you need to invest more effort:

Here is a link to the relevant documentation:

Recursive Functions in Power Query | Power BI Data (enterprisedna.co)


Of course, you are welcome to share your new findings with us.

 

Best Regards,

Leroy Lu

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
foodd
Super User
Super User
rajendraongole1
Super User
Super User

Hi @PIYUSHPRAJAPATI -can you try below measure and replace the columns and tables as per your file.

 

Measure:

 

Running total = calculate([profittotal],
datesbetween('Date'[Date],minx(all('Date'),
    'Date'[Date]),max('Date'[Date])))

 

rajendraongole1_1-1718711729753.png

 

 

rajendraongole1_0-1718711699292.png

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 





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

Proud to be a Super User!





I want answer in the last three month only and they took value from the previous three month only..... as i mentioned in the question like in 2015,01 answer is 29,785,822.02 and in the 2015, 02 answer is 47,141,824.12 like wise for the 2015,03. But you mentioned in the solution after the 2014 december in the 2015 whole year in each month same solution that i got but i think this kind of the scenario is not possible as i think.

 

Anonymous
Not applicable

Thanks for the reply from @foodd and@rajendraongole1,please allow me to provide another insight:
Hi,@PIYUSHPRAJAPATI 
Regarding the issue you raised, my solution is as follows:

1.As for your question, our answer is that your answer is correct, in powerbi if you want to use dax to implement the first three data accumulation and so repeated, is a typical recursive problem, which is difficult to achieve in powerbi using dax.

Solved: Recursion in DAX - Microsoft Fabric Community

 

2.You can try doing the calculation in excel first and then importing it into power bi. This is by far the easiest way. Here is a link to the relevant documentation:
How to create recursive functions in Excel with LAMBDA (spreadsheetweb.com)

 

3.You can also implement this function in PowerQurey, but you need to invest more effort:

Here is a link to the relevant documentation:

Recursive Functions in Power Query | Power BI Data (enterprisedna.co)


Of course, you are welcome to share your new findings with us.

 

Best Regards,

Leroy Lu

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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