Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
i have a column CountCumulative and it has the value 1 or is blank with dates. the dates are repeated because there can be multiple sales on one day. if a sale has happen the value in CountCumulative should be 1 otherwise it should be blank. Now i want a cumulative sales. like a total of how many sales were on day 1 and then the total sales of day2 and also add day 1 sales into it. i want it date wise.
Table name is Logs_View.
This is whats showing right now which is obviously not correct.
below is the formula im using
This is whats showing in the Editor.
I used this
and its still the same
The issue with your current formula for calculating cumulative sales in Power BI DAX likely arises from how it handles duplicate dates. Here's a refined approach that incorporates logic to address repeated dates in your "CountCumulative" column:
1. Define a Measure:
Create a new measure in Power BI and name it Cumulative Sales.
2. DAX Formula:
The issue with your current formula for calculating cumulative sales in Power BI DAX likely arises from how it handles duplicate dates. Here's a refined approach that incorporates logic to address repeated dates in your "CountCumulative" column:
1. Define a Measure:
Create a new measure in Power BI and name it Cumulative Sales.
2. DAX Formula:
Cumulative Sales = VAR LatestDate = MAX(Logs_View[Date]) RETURN CALCULATE( SUM(Logs_View[CountCumulative]), FILTER( ALL(Logs_View), (Logs_View[Date] <= EARLIER(LatestDate)) && ( // Handle duplicate dates: OR( // If not the latest date, include all rows for the date NOT(Logs_View[Date] = LatestDate), // For the latest date, include only rows with CountCumulative = 1 Logs_View[Date] = LatestDate && Logs_View[CountCumulative] = 1 ) ) ) )
Explanation:
This approach addresses the repeated date issue by ensuring that on the latest date, only the first sale (with "CountCumulative" = 1) is considered in the cumulative sum, while all sales are included for other dates.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
Hello,
Thank you for replying but this keep loading and doesnt run as it says it runs out of memory. Im have 24gb of RAM and yet it says that, Can you use this a little efficiently ?
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
25 | |
10 | |
7 | |
6 | |
6 |
User | Count |
---|---|
30 | |
11 | |
11 | |
10 | |
6 |