I used the above dax but seems to not get the correct answer.
Attaching the file for reference.
Appreciate any inputs on where I am going wrong in my dax calculations. Running Total.xlsx (11.6 KB) RunningTotals.pbix (37.9 KB)
The expected output is in Sheet1 and pasting here too.
Okay, lots of different problems here contributing to the DAX not working.
When doing time intelligence calculations such as cumulative/running totals by date, you need a proper date table in your data model.
The date table needs to be marked as a date table.
This should be done as a measure, not as a calculated column.
The DAX for the running total needs to be corrected to the following (you can substitute ALLSELECTED for ALL if you’re going to be dynamically slicing or filtering)
I would strongly suggest going through the Data Transformations and Modeling course in the portal. The most important element of Power BI is getting your data model set up correctly. If you fail to do that, it doesn’t matter how skillful you are with DAX – it’s likely your calculations will not return accurate results even if your DAX is correct.
I hope this is helpful. Full solution file attached below.
Thank you very much Brian for your suggestions. I will go through the Data Transformations and Modeling course.
I do have the date table in my model. I did not get to create it in the mockup data.
Thank you for pointing out Rajesh @Rajesh . Extending this problem, I have to calculate the sum of the max value of a column. Attaching the excel and the PBIX for reference Running Total.xlsx (14.5 KB) SumofMaxValues.pbix (75.7 KB)
. I have a column “Value” and it has multiple records for the same day with same value. But when calculating rolling sum, I need to pick the max value for the date and add up the totals for the dates selected. The way to go about is calculating the max value for each day and do a sumx on the max values. I was able to get to the point where I found the max value for the dates selected. But to get the totals of these max values, I am stuck. Appreciate your inputs. I tried your measure but it gives blank values for some of the date ranges.
Basically, calculating the rolling sum of the max values of the date range selected is what I am trying to calculate. The starting date of the date slicer should not change the values but the values should change with the end date of the date slicer.