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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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