Compare Measure using 2 Different Date Ranges with Inactive Relationship / USERELATIONSHIP
Reference: SQLBI DAX Patterns, Comparing Different Time Periods
You have a Date table and a Comparison Date table in order to compare a measure using 2 different date ranges.
In the Data Model, there is a many-to-1 relationship between Date and Comparison Date and the relationship is inactive.
The relationship is activated in CALCULATE; e.g.
CALCULATE([Sales Amount], REMOVEFILTERS('Date', USERELATIONSHIP('Date'[Date], 'Comparison Date'[Comparison Date]
Comments
Post a Comment