Forum Discussion
Help With Cumulative Line Chart Showing Year Over Year Sales Growth
- 2 years ago
OK, now that's a measure problem. You need a YTD cumulative measure.
The shortest solution is probably
TOTALYTD ( SUM ( 'deal list'[Deal - Value] ), 'DateTable'[Date] )but I'm not a fan of built-in time-intelligence functions.
There are lots of ways of writing a TOTALYTD without time-intelligence. For example, a pattern like this one here:
Month-related calculations – DAX Patterns
Or you can use the newer WINDOW function and write something like this:
Amount YTD = CALCULATE ( SUM ( 'deal list'[Deal - Value] ), WINDOW ( 1, ABS, 0, REL, ORDERBY ( 'DateTable'[Date], ASC ), PARTITIONBY ( 'DateTable'[Year] ) ) )
It's hard to tell what's going wrong here. I'm not sure why you have two calendar/dates tables and I can't tell what column in the deal table the dates are related to.
The Calendar table is from another tutorial I watched. The "DateTable" is the original one created for this report. Dates are related to the Won Time Date in the Deals table. Do you recommend I remove the Calendar table to start?
- AlexisOlson2 years ago
Super User
I'd recommend using one or the other (not both) unless you have a specifc use case needing both.
Dates are related to the Won Time Date in the Deals table.
This might be your issue. If you are trying to connect a date column to a datetime column, you won't get many matches. Make sure both columns are date type for the relationship to function as expected.