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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Create Measure for calculating daily sales from cumulative sales

Hi,

Anyone could help me out to obtain daily sales from cumulative sales as shown alongside. I want to be able to visualise monthly trend in daily sales in my line chart.

 

Thanks

q1.JPG

 

 

1 ACCEPTED SOLUTION

Hi, @Anonymous 

Sorry for not taking care of the total line.

please check the below DAX measure and the link down below.

 

each date sales =
IF (
ISFILTERED ( 'Table'[Date] ),
[Cumulate Sales Total] - [Previous Date Sales],
SUMX (
VALUES ( 'Table'[Date] ),
[Cumulate Sales Total] - [Previous Date Sales]
)
)

 

https://www.dropbox.com/s/odbpvv2d5xjuhy6/kunal.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

5 REPLIES 5
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

I created a sample pbix file like the below picture.

Please check the link down below whether it is what you are looking for.

 

Picture1.png

 

All measures are in the sample pbix file.

 

https://www.dropbox.com/s/odbpvv2d5xjuhy6/kunal.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

@Jihwan_Kim , each date sales gives a wrong total. It should sum upto 276.

I tried using below DAX code but doesn't help,

 

Daily Sales=

var current_day= max(Sales[Date])

var current_day_sales= calculate(sum(Sales[Amount]), Sales[Date]= current_day)

 

var previous_day_sales= calculate(sum(Sales[Amount]),PREVIOUSDAY(Sales[Date]))

return

current_day_sales-previous_day_sales

Hi, @Anonymous 

Sorry for not taking care of the total line.

please check the below DAX measure and the link down below.

 

each date sales =
IF (
ISFILTERED ( 'Table'[Date] ),
[Cumulate Sales Total] - [Previous Date Sales],
SUMX (
VALUES ( 'Table'[Date] ),
[Cumulate Sales Total] - [Previous Date Sales]
)
)

 

https://www.dropbox.com/s/odbpvv2d5xjuhy6/kunal.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
amitchandak
Super User
Super User

@Anonymous , Create a new column as

 

new column =
var _max = maxx(filter(Table, [Date] <earlier([date])),[Date])
return
[cumm_sales] - maxx(filter(Table, Table[Date] =_max),[cumm_sales])

 

if all dates are continuous then

 

new column =
[cumm_sales] - maxx(filter(Table, Table[Date] =earlier([date]) -1 ),[cumm_sales])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks @amitchandak ,

Any help on the measure will be much appreciated. Columns using DAX will take huge space with my data.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.