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
Keith011
Helper III
Helper III

Cumulative sales data

hi there

 

my goal is to calculate cumulative revenue. I have a sales table (refer below) and a date table(refer below). I have established a relation between those 2 using 'confirmDate' and 'MonthnYear' (many-to-one, filter both way)

How can i achieve my desired table? with a measure.

 

This is my desired table

confirmDateCumulative Revenue
202101100
202102600
202103800
202104850
2022041750
2022091980

 


Sales Table

confirmDateRevenue
202101100
202102500
202103200
20210450
202204900
202209230

 

my fancy Date Table

DateMonthnYear
Friday, January 1, 2021202101
Monday, February 1, 2021202102
Monday, March 1, 2021202103
Thursday, April 1, 2021202104
Saturday, May 1, 2021202105
Tuesday, June 1, 2021202106
Thursday, July 1, 2021202107
Sunday, August 1, 2021202108
Wednesday, September 1, 2021202109
Friday, October 1, 2021202110
1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Keith011 

 

You don't even need a date sheet. You can try the following methods.

Cumulative Revenue = 
CALCULATE ( SUM ( 'Table'[Revenue] ),
    FILTER ( ALL ( 'Table' ),
        [confirmDate] <= SELECTEDVALUE ( 'Table'[confirmDate] )
    )
)

vzhangti_0-1684993216533.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Keith011 

 

You don't even need a date sheet. You can try the following methods.

Cumulative Revenue = 
CALCULATE ( SUM ( 'Table'[Revenue] ),
    FILTER ( ALL ( 'Table' ),
        [confirmDate] <= SELECTEDVALUE ( 'Table'[confirmDate] )
    )
)

vzhangti_0-1684993216533.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

lbendlin
Super User
Super User

your date table is not fancy enough. to use time intelligence functions your calendar table needs to be contiguous and covering.

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.