0
votes

I'm learning DAX and I'm trying to make a measure for Sales Last year.

this formula works :

Sales LY = CALCULATE([Sales CY],SAMEPERIODLASTYEAR(Date[Date]))

But when I add FILTER to the measure, it gives me the values from the current year like "Sales CY"

Sales LY = `CALCULATE([Sales CY], Filter (dim_date, SAMEPERIODLASTYEAR (Date[Date]) ))`
  • I already have a date filter on the page relative date in this year
  • the invoices Table and Date table are joined on the date of the creation of the invoice (createdat)

Data Model representation

Any ideas what's the meaning behind the things in blue circles?

1

1 Answers

0
votes

The FILTER function expects a condition that can be checked for each row of the table instead of a column of dates returned by SAMEPERIODLASTYEAR, so I wouldn't expect the second version to work.

I think the bits circled in blue are emphasizing that you are connected an imported data table to a DirectQuery table (different storage modes).