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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Kurt4597
Helper I
Helper I

Cumulative Total By Date

Hi all,

 

Stuck on this issue - any help would be much appreciated

 

DateDim

Kurt4597_0-1684776012838.png

 

Sales

Kurt4597_1-1684776040673.png

 

I am trying to create a measure that is a cumulative total of the sales and is able to be filtered by the date table. I have the following measure which produces the cumalative sales

 

Cumalatve Sales = 
CALCULATE (
    SUM ( Sales[Sales] ),
    FILTER (
        ALL ( DateDim[Date] ),
        DateDim[Date] <= MAX ( DateDim[Date] )
    )
)

 

 
Kurt4597_3-1684776251829.png

 

However it not adjusting correctly for the date. As you can see from the graph, the first value is 1,246 which is a cumulative total of the previous three days. Instead it should start at 151 as the date filter is set to 5th March


 Kurt4597_4-1684776317944.png

 

Any help would be much appreciated. 
Sample File - 

 

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi  @Kurt4597 , 

You can modify Measure to the following form:

Measure = 
CALCULATE( 
    SUM('Sales'[Sales]), 
    FILTER(ALLSELECTED(DateDim), 
    'DateDim'[Date]<=MAX('DateDim'[Date])) 
    ) 

Result: 

veqinmsft_0-1684916199871.png

 

 
 

Best Regards, 

Liu Yang 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly 
 

View solution in original post

1 REPLY 1
v-eqin-msft
Community Support
Community Support

Hi  @Kurt4597 , 

You can modify Measure to the following form:

Measure = 
CALCULATE( 
    SUM('Sales'[Sales]), 
    FILTER(ALLSELECTED(DateDim), 
    'DateDim'[Date]<=MAX('DateDim'[Date])) 
    ) 

Result: 

veqinmsft_0-1684916199871.png

 

 
 

Best Regards, 

Liu Yang 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly 
 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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