0
votes

Hi I am trying to get total YTD amount for last year.

When I select October 2020 my current YTD amount works here is what it looks like :

YTDAmount = TOTALYTD(sum(PCSReport[PD]),PCSReport[PCSMonth])

However, I want to show YTD October 2019 and for some reason it is showing blank. This is the DAX I made :

LYTDAmount = TOTALYTD(sum(PCSReport[PD]), SAMEPERIODLASTYEAR(PCSReport[PCSMonth]) )
1

1 Answers

0
votes

Since your calculations are correct, here is what might be the problem.
To work with time intelligence functions (TOTALYTD,DATESYTD ... ) you must have at leat one date table with an active relationship to your fact table.

A date table is a table that meets the following requirements:

  1. It must have a column of data type date (or date/time)—known as the date column.
  2. The date column must contain unique values.
  3. The date column must not contain BLANKs.
  4. The date column must not have any missing dates.
  5. The date column must span full years. A year isn't necessarily a calendar year (January-December). The date table must be marked as a date table.