With my LY calculation i want to calculate up to the same day this year, even though i’m looking at the whole month of August. ie, it’s the 14th Today, i want to know what sales were up to the 14th August Last Year, the calc i’m using is giving me the whole month.
Ok, So the solution in the video works when viewing the data by day, such as in the chart.
I wanted to use a series of cards to show the sales to date for the month vs the same day of the month last year and work out a percentage vs last year MTD.
I added 2 columns to my date table view from the DW.
Month2: contains the month name & year (Sep 2018), except for the Current Month which contains the text “Current Month”
DayDescr: Blank except for values for “Today” and “Yesterday”
Invoice Amount MTD LY =
IF (SELECTEDVALUE('Date'[Month2]) = "Current Month",
CALCULATE(
[Invoice Amount Same Mth LY],
FILTER('Date', 'Date'[DayDescr] = "Yesterday")
),
[Invoice Amount Same Mth LY]
)
Invoice Amount Same Mth LY = TOTALMTD([Invoice Amount],DATEADD(‘Date’[Date],-1,YEAR))