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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
bluestonewales
Frequent Visitor

Cumulative Sum Chart

HI,

 

I am struggling to get a measure to show the cumulative impact of sales for a particular product (which has a valid date) and an insert date (which is when the booking was created)

 

I am using the formula below

 

Cummulative Actual Revenue =
CALCULATE (
sum(DetailedBookingsTable[RV]),filter(DetailedBookingsTable,DetailedBookingsTable[Arrival Date].[Date]),
FILTER (
ALL ( DetailedBookingsTable),
DetailedBookingsTable[Insert Date].[Date] <= MAX(DetailedBookingsTable[Insert Date].[Date] )))  

 

and the chart looks like below

 

Capture Snip.JPG

 

It is accurately showing the daily sales for the product but not cumulatively adding them up.

 

Once I have got this working then I have to try to get the same data for prior year on the same graph,.

 

Any help would be appreciated.

5 REPLIES 5
Eric_Zhang
Microsoft Employee
Microsoft Employee


@bluestonewales wrote:

HI,

 

I am struggling to get a measure to show the cumulative impact of sales for a particular product (which has a valid date) and an insert date (which is when the booking was created)

 

I am using the formula below

 

Cummulative Actual Revenue =
CALCULATE (
sum(DetailedBookingsTable[RV]),filter(DetailedBookingsTable,DetailedBookingsTable[Arrival Date].[Date]),
FILTER (
ALL ( DetailedBookingsTable),
DetailedBookingsTable[Insert Date].[Date] <= MAX(DetailedBookingsTable[Insert Date].[Date] )))  

 

and the chart looks like below

 

Capture Snip.JPG

 

It is accurately showing the daily sales for the product but not cumulatively adding them up.

 

Once I have got this working then I have to try to get the same data for prior year on the same graph,.

 

Any help would be appreciated.


@bluestonewales

I see two filters in your case, usually they shall all apply ALL(table) in this kind of case. And there're two dates in the DAX, it can't be determined how the the two dates affact the DAX without known your data model.

 

You DAX is very close. Check a Cumulative Sum demo for your case.

 

Capture.PNG

 

We could provide more straightforward advice if you can share a sample pbix in your case.

 

 

dedelman_clng
Community Champion
Community Champion

I think the issue you are having is the order of operations of the multiple filters on a single table.  Lets see if SUMX and pre-filtering the table helps out:

 

 

Cumulative Actual Revenue =
CALCULATE (
    SUMX ( FILTER ( DetailedBookingsTable, DetailedBookingsTable[Arrival Date]), DetailedBookingsTable[RV] ),
   FILTER (
        ALL ( DetailedBookingsTable[Insert Date] ),
        DetailedBookingsTable[Insert Date].[Date]
            <= MAX ( DetailedBookingsTable[Insert Date].[Date] )
    )
)

 

Also, please check out DAX Formatter.  This is a free service that puts your DAX into a standardized format that is easier to read.

 

Hope this helps,

David

Hi,

 

Thanks for this, unfortunately it doesn't work as it comes up with the error below

 

A single value for variaton 'Date' for column 'Insert Date' in table 'DetailedBookingsTable' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result

 

To give some context to the original post. Each sale is recorded as a record in the detailed booking table including details of the product purchased (the date the product purchased is valid on) as well as the insert date that the booking was created. 

 

Data set is some 70,000 records, (we have data fact table which works out all of our financial periods etc which has a many to one relationship from the detailed bookings table)

 

Simon

Try changing SUMX to CALCULATE and SUM ? 

 

Cumulative Actual Revenue =
CALCULATE (
    CALCULATE(SUM(DetailedBookingsTable[RV]), DetailedBookingsTable[Arrival Date]),
    FILTER (
        ALL ( DetailedBookingsTable[Insert Date] ),
        DetailedBookingsTable[Insert Date].[Date]
            <= MAX ( DetailedBookingsTable[Insert Date].[Date] )
    )
)

Hi,

 

Thanks but still no luck, same error 

 

A single value for variaton 'Date' for column 'Insert Date' in table 'DetailedBookingsTable' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

 

Simon.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors