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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.