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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Tony5
Helper I
Helper I

Running Totals with Filtering

I'm attempting to migrate a dashboard from Tableau to PowerBI, and I'm unsure how to implement a specific feature.

 

Basically, if I have a column for sales for the months of Jan Feb Mar, I need a column that shows cumulative sales, at the same time, if I filter to only show Feb, the cumulative should contain Jan+Feb. Likewise, if I only filter to show March, it should show the cumulative sales of all 3 months.

 

Below is a Tableau forum post of what I want to happen.

https://community.tableau.com/thread/187499

 

1 ACCEPTED SOLUTION
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Tony5,

Please create another table named "Month" including month, there is no ralationship between table Month and your sales table. 

1. Create a sclier including Month[month] column.

2. Create a measure to calculate the running total using the formula below.

running total = VAR mm=SELECTEDVALUE(Month[Month])
Return CALCULATE(SUM(Test[sales]),FILTER(Test,Test[Month]<=mm))


3. Please see the screenshot, when you click 1, it disply the sum sale of jan, when you click 2, it disply the sum sale of jan+feb. You will get expected result.

picture1picture1  2.PNG
Please download the attachment for more details.

Best Regards,
Angelia

View solution in original post

1 REPLY 1
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Tony5,

Please create another table named "Month" including month, there is no ralationship between table Month and your sales table. 

1. Create a sclier including Month[month] column.

2. Create a measure to calculate the running total using the formula below.

running total = VAR mm=SELECTEDVALUE(Month[Month])
Return CALCULATE(SUM(Test[sales]),FILTER(Test,Test[Month]<=mm))


3. Please see the screenshot, when you click 1, it disply the sum sale of jan, when you click 2, it disply the sum sale of jan+feb. You will get expected result.

picture1picture1  2.PNG
Please download the attachment for more details.

Best Regards,
Angelia

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.