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
yoshi_matsu
Frequent Visitor

How to calculate cumulative totals up to the date selected in the slicer

I have two metrics:
① Number of new sales
② Total number of sales

① The number of new sales is the number of purchases made on the date selected in the slicer.
② The total number of sales is the number of purchases made up until the date selected in the slicer.

For example, based on the data in the table below, if I select 02/2024 in the slicer, ① would be 100 and ② would be 150.

 

monthsales figures
1/202450
2/2024100
3/202414
4/202454

 

Additionally, the structure of the calendar master set in the slicer is as follows, and I would like to be able to select by business year, business month, and business day.

 

datebusiness yearbusiness monthbusiness day
1/1/2024202411
1/2/2024202412
1/3/2024202413

1/4/2024

202414

 

How can I achieve this?

1 ACCEPTED SOLUTION
Irwan
Super User
Super User

hello @yoshi_matsu 

 

please check if this accomodate your need.

Irwan_0-1726100866284.png

Irwan_1-1726100924320.png

 

create a new measure with following DAX.

Cumulative = 
var _Date = SELECTEDVALUE('Calendar'[date])
Return
SUMX(
    FILTER(
        ALL('Sales'),
        'Sales'[month]<=_Date
    ),
    'Sales'[sales figures]
)
 
also since you are taking calendar date as slicer, dont forget to create a relationship between those two tables.

Hope this will help.
Thank you.

View solution in original post

3 REPLIES 3
yoshi_matsu
Frequent Visitor

Thank you so much!

hello @yoshi_matsu 

 

glad it works.

 

Thank you.

Irwan
Super User
Super User

hello @yoshi_matsu 

 

please check if this accomodate your need.

Irwan_0-1726100866284.png

Irwan_1-1726100924320.png

 

create a new measure with following DAX.

Cumulative = 
var _Date = SELECTEDVALUE('Calendar'[date])
Return
SUMX(
    FILTER(
        ALL('Sales'),
        'Sales'[month]<=_Date
    ),
    'Sales'[sales figures]
)
 
also since you are taking calendar date as slicer, dont forget to create a relationship between those two tables.

Hope this will help.
Thank you.

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.