The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 ?
User | Count |
---|---|
25 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |