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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Matt_dev
Frequent Visitor

DAX Running Total Problem

I have seen versions of this question asked and answered here many times but I can't get any of those answers to work for my situation.

I have a dataset called VW3 which contains sales data over dimensions like location, staff member, project and date.

I have created a new dataset which contains only the distinct dates from VW3 called SAD. I have also created a measure on SAD called Selected

Selected = SELECTEDVALUE('SAD'[Date])


SAD and VW3 have a 1 to many relationship between VW3.ShiftDate AND SAD.Date. 

I have a date slicer (which uses the Between style) using the SAD dataset and I want to create a total of sales for that period, ignoring all other dimensions and have tried the following 

GMRunningTotal =
VAR StartDate = MIN(SAD[Date])
VAR EndDate = MAX(SAD[Date])
RETURN
CALCULATE(
    SUM(VW3[PL]),
    FILTER(
        ALL(SAD),
        'SAD'[Selected] >= StartDate && 'SAD'[Selected] <= EndDate
    )
)


I know I am doing something wrong because GMRunningTotal changes if I alter the value of the dimension slicer but I only want date to affect it.

Please, if you are able, tell me where I am going wrong because I have become very confused and do not know how to proceed.

Thanks in advance 


1 ACCEPTED SOLUTION
Kedar_Pande
Super User
Super User

@Matt_dev 

Try:

GMRunningTotal = 
CALCULATE(
SUM(VW3[PL]),
DATESBETWEEN(
SAD[Date],
MIN(SAD[Date]),
MAX(SAD[Date])
)
)

 

If this answer helped, please click 👍 or Accept as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

I know I am doing something wrong because GMRunningTotal changes if I alter the value of the dimension slicer but I only want date to affect it.

Don't join the tables if you don't want the filter context to impact your results. Use overrides like REMOVEFILTERS, and consider using window functions instead.

Kedar_Pande
Super User
Super User

@Matt_dev 

Try:

GMRunningTotal = 
CALCULATE(
SUM(VW3[PL]),
DATESBETWEEN(
SAD[Date],
MIN(SAD[Date]),
MAX(SAD[Date])
)
)

 

If this answer helped, please click 👍 or Accept as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande

Thank you very much, that is exactly what I needed 

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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