0
votes

I have a simple cumulative sales measure that works on another data model, but not here, and for the life of me I can't figure out why.

Here's a .pbix with just the tables and measures that are relevant: AdventureWorksDW.pbix

First, there's a simple summation measure:

 Internet Sales Total = SUM(FactInternetSales[SalesAmount])

The cumulative measure just grabs the current date context, gets all dates YTD for it, and uses them to calculate the context for the summation measure:

 Cumulative (YTD) Sales = 

 VAR DateContext = LASTDATE(DimDate[FullDateAlternateKey])    // Get context date
 VAR YTDDatesForYear = DATESYTD(DateContext)                  // Get all dates in current context year
 RETURN CALCULATE([Internet Sales Total], YTDDatesForYear)    // Show Total Sales for dates

But the measure is not returning the cumulative sales for the YTD - it's just giving the total for that day. (Ignore the second sales amount column):

enter image description here

1

1 Answers

0
votes

Figured it out - the DateKey column was just defined as a number (not a date) format. Once I switched it to the a column in my calendar that is formatted as a date, everything worked.