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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.