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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
pc1
New Member

cumulative totals between filtered dates

Hi Newby here... how can i change this expression to sum values between dates selected in my filter. i assume i need a min in their somewhere. appreciate your help.

 

Cumulative Quantity =
CALCULATE (
    SUM ( FinData[Fcast Dec] ),
    FILTER (
        ALL ( 'Calendar'[Date] ),
        'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
    )
)
 
 
1 ACCEPTED SOLUTION

@pc1 Create a calculated column using the following DAX. You will be able to get the cumulative sum.

Month = FORMAT(FinData[Date],"mmm-YYYY")

View solution in original post

3 REPLIES 3
moumipanja
Employee
Employee

@pc1 Do you have a Date column in your FinData table? In that case, the following code will return the cumulative sum of Fcast Dec column for dates selected in the slicer.

 

Cumulative Quantity = 
SumX(
    FILTER (
        ALLSELECTED('FinData'[Date]),
        'FinData'[Date]<=MAX('FinData'[Date])
    ),
    CALCULATE(SUM([Fcast Dec]))
)

i dont have date but i have a mmm-yy column in text. I have the same mmm-yy column in my calendar table for sorting the time series in all my charts.

 

i've played with your formula with constructed date data and whilst it seems to work on dates it does'nt work with my mmm-yy (as text) column. Do you know why this might be the case?

 

cheers

@pc1 Create a calculated column using the following DAX. You will be able to get the cumulative sum.

Month = FORMAT(FinData[Date],"mmm-YYYY")

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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