Find values in two different measures / Measure that summarize transaction values for year-to-date - SQL to DAX

61 views Asked by At

I'm looking for a measure that will summarize amounts for customers that have been in two chosen periods of time. For example, I have this measure that summarize transaction values for year-to-date. What I need to create is a measure that summarize those transactions values (YTD) for customers that made purchases during this YTD as well as previous year YTD.

I'm not really familiar with the syntax for this in DAX but with SQL I guess I would use the IN operator for the customerID.

Something like (not YTD)

SELECT
SUM(Amount)
FROM
FactTable
WHERE
Date='2015-06'
AND CustID IN (Select CustID FROM FactTable WHERE Date='2014-06') 
AND CustID IN (Select CustID FROM FactTable WHERE Date='2015-06')
0

There are 0 answers