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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
yoshi_matsu
New Member

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
Solution Sage
Solution Sage

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
New Member

Thank you so much!

hello @yoshi_matsu 

 

glad it works.

 

Thank you.

Irwan
Solution Sage
Solution Sage

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.