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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Kuri_191
Frequent Visitor

Cumulative Sales per Day

Hello,

 

Hoping you can help me, because I've looked online and I can't find a solution for this.

 

I want to create a chart where I show the cumulative sales per day (not per date), using a table that contains the sales amount per date/per product/per channel. 

 

So I have this sample table below:

 

DateProductChannelAmount
01/05/2025AStore55
01/05/2025AOnline44
01/05/2025APerson37
01/05/2025BStore8
01/05/2025BOnline44
01/05/2025BPerson95
02/05/2025AStore16
02/05/2025AOnline27
02/05/2025APerson10
02/05/2025BStore91
02/05/2025BOnline85
02/05/2025BPerson88
04/05/2025AStore56
04/05/2025AOnline79
04/05/2025APerson77
04/05/2025BStore91
04/05/2025BOnline77
04/05/2025BPerson61
04/05/2025CStore22
04/05/2025COnline39
04/05/2025CPerson100
05/05/2025CStore36
05/05/2025COnline55
05/05/2025CPerson2

 

The first particular thing about this chart is that I need to use days and not dates, meaning that if the I'm looking at product A, the cumulative value for the 1st day are the cumulative sales of 1st of May, because it's the first day of sales for that product. For product C, the 1st day is the date 4th of May. The reason for this is because I want to compare the first days/weeks/months of each product per channel, in order to spot selling patterns.

 

Product A
DateDaySumCumulative
01/05/20251136136
02/05/2025253189
03/05/202530189
04/05/20254212401

 

Product C
DateDaySumCumulative
04/05/20251161161
05/05/2025293254

 

Another thing that I need is that the days without sales, must be considered to the chart with cumulative values from the previous days. 

 

Total
DateDaySumCumulative
01/05/20251283283
02/05/20252317600
03/05/202530600
04/05/202546021202
05/05/20255931295

 

Hope this description helps.

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

ThxAlot_0-1746272150625.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

6 REPLIES 6
v-ssriganesh
Community Support
Community Support

Hi @Kuri_191,

May I ask if you have resolved this issue? If so, please mark it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

 

 

 

v-ssriganesh
Community Support
Community Support

Hi @Kuri_191,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

v-ssriganesh
Community Support
Community Support

Hi @Kuri_191,

Thank you for posting your query in the Microsoft Fabric Community Forum, and thanks to @ThxAlot@lbendlin & @anilelmastasi for sharing valuable insights.

 

Could you please confirm if your query has been resolved by the provided solution? If so, please mark it as the solution. This will help other community members solve similar problems faster.

Thank you.

ThxAlot
Super User
Super User

ThxAlot_0-1746272150625.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



lbendlin
Super User
Super User

1. use the WINDOW function for running total

 

lbendlin_0-1746218048597.png

2. To report on things that are not there you need to use crossjoins and/or disconnected tables. In your case a dimension table with all dates.

 

lbendlin_1-1746218287394.png

 

 

anilelmastasi
Super User
Super User

Hello @Kuri_191 ,

 

You need to calculate the running day number for each product — this means the first date a product has sales is Day 1, the next date is Day 2, etc., even if some dates are missing in between. This is an calculated column DAX:
DayNumber =
RANKX(
FILTER(
Sales,
Sales[Product] = EARLIER(Sales[Product])
),
Sales[Date],
,
ASC,
DENSE
)

This gives you the Day column you want per product.

 

 

And then you need to calculate daily sum per product, create a measure:

Daily Sales = SUM(Sales[Amount])

 

Now create a cumulative measure:

Cumulative Sales =
CALCULATE(
[Daily Sales],
FILTER(
ALL(Sales),
Sales[Product] = MAX(Sales[Product]) &&
Sales[DayNumber] <= MAX(Sales[DayNumber])
)
)

 

For your last need:

---Create a Date table in your model — make sure it covers all dates.

---Create a Product-Day matrix:

-Add Date from the Date table.

-Add Product.

-Show Cumulative Sales measure.

---In your visual → turn on “Show items with no data” for the Date axis.

 

Final Cumulative Sales =
VAR LastValue =
CALCULATE(
[Cumulative Sales],
FILTER(
ALL(Sales),
Sales[Product] = MAX(Sales[Product]) &&
Sales[DayNumber] <= MAX(Sales[DayNumber])
)
)
RETURN
COALESCE(LastValue,
CALCULATE(
MAXX(Sales, [Cumulative Sales]),
FILTER(
ALL(Sales),
Sales[Product] = MAX(Sales[Product]) &&
Sales[DayNumber] < MAX(Sales[DayNumber])
)
)
)

 

If this solved your issue, please mark it as the accepted solution.

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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