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
adriansuteu
Advocate I
Advocate I

How to display total sales until selected month (from slicer)

Hello.

 

Let's assume the following situation:

$1000 - sales on March

$2000 - sales on April.

 

If I select March from slicer the graph shows 1000, if I select April from slicer the graph shows $2000, but I want it to show the Total sales until April included ($3000).

I have tried the following formula but it does not work:

Total Sales= Calculate(sum('Open Courses'[New Sales]), filter('Open Courses','Open Courses'[Date] <= calculate(max('Calendar'[DateKey]))))

I have a 1to* relationship between Calendar[DateKey] and Open Courses[Date].

 

Please help me figure it out!

1 REPLY 1
fhill
Resident Rockstar
Resident Rockstar

Check out this article on creating a Cumulative Custom Column in your data...  

https://community.powerbi.com/t5/Desktop/DAX-Running-Total-YTD/td-p/21576

 

I used this to create the 'Cumulative by Date' graph on the far right below.  (Bars show filter boarders).

P.S.  It seems like a 'Before' slicer might be even easier.  See my 2 middle examples where I just use a standard card of 'Sales' with the Slicer and the 'Before' option to only select end dates?  ( You said drop down, so that might not help you..)

 

Cumulative =
VAR RowDate = Table5[Date]
RETURN
CALCULATE (
SUM ( Table5[Sales] ),
FILTER (
Table5,
Table5[Date] <= RowDate
)
)Capture.PNG




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




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.

Top Solution Authors
Top Kudoed Authors