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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
navin1491
Frequent Visitor

Cumulative sum based on date range slicer and group by

I have 2 employees and the sales values ordered by date in the table. I want to create a table where I filter by date and the cumulative sales per employee should be displayed for the corresponding date.

 

Employee sales tableEmployee sales table

max_selected = MAX(Query1[Date])

min_selected = MIN(Query1[Date])

Measure= 
CALCULATE(
    (SUMX(VALUES(Query1[ID]),CALCULATE(SUM(Query1[Sales])))),
    FILTER (ALL(Query1),
        [Date] >= [min_selected]
            && [Date] <= [max_selected]
    ))

Can someone please help me here?

12 REPLIES 12
AlB
Community Champion
Community Champion

Hi  @navin1491

Let's try this:

 

1. Place a table visual in your report with Query1[ID] in the rows

2. Place Query1[Date] in a slicer

3. Place in values of the table a  measure like: 

 

CumulativeSales =
CALCULATE (
    SUM ( Query1[Sales] ),
    FILTER ( ALL ( Query1[Date] ), Query1[Date] <= MAX ( Query1[Date] ) )
)

 

 

navin1491
Frequent Visitor

@AlBThank you so much for you help. There is one more problem that I'm facing now. I also want to filter with the total sales value which would interact with the date slicer. Can you please help me with the creation of total sales value filter that would change when date slicer changes. Thanks!

AlB
Community Champion
Community Champion

@navin1491

I don't think I understand what you mean. Can you maybe provide an example to clarify?

navin1491
Frequent Visitor

Hi @AlB

 

In the above image, we have the sales table, date slicer and total sales slicer(assumed). I want to have a slicer with cumulative sales value at ID level which will change when the date range slicer is changed.

 

For example, when I select only November and December months, the value in the sales filter should automatically change to 2300-4600 based on the example provided.

 

Please let me know if any other details are needed. Thanks! 

Anonymous
Not applicable

HI @navin1491,

 

>>In the above image, we have the sales table, date slicer and total sales slicer(assumed). I want to have a slicer with cumulative sales value at ID level which will change when the date range slicer is changed.

Nope, this is impossible. You can't use one slicer to let other slicer dynamic changed.

 

Regards,

Xiaoxin Sheng

AlB
Community Champion
Community Champion

@navin1491

As @Anonymous says, you cannot do that. May I ask what you are trying to achieve? Maybe it can be done in another way. What would be the point of having the Sales slicer change?

navin1491
Frequent Visitor

@AlB @Anonymous I'm trying to filter by date and also cumulative sales values. For example, if I filter by date, the cumulative sales values only between those dates should be displayed and the sales filter value should also change. And thank you for all your help! Appreciate the help! 🙂

Anonymous
Not applicable

Hi @navin1491,

 

Maybe you can try to define query parameter a filter to filter on query editor side, it can affect source table of slicers.

Deep Dive into Query Parameters and Power BI Templates

 

Regards,
Xiaoxin Sheng

 

@AlBI'm sorry the image didn't get attached. 

I have 2 employees and the sales values ordered by date in the table. I want to create a table where I filter by date and the cumulative sales per employee should be displayed for the corresponding date.

max_selected = MAX(Query1[Date]) min_selected = MIN(Query1[Date]) Measure = CALCULATE( (SUMX(VALUES(Query1[ID]),CALCULATE(SUM(Query1[Sales])))), FILTER (ALL(Query1), [Date] >= [min_selected] && [Date] <= [max_selected] )) This is the query that I'm using but it returns the sum of all the users, but not the sum of sales values for individual users.

Image for illustrationImage for illustration

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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