I am trying to write a measure that calculates the number of days each store was open each month.
I have Open Dates for each store and the value that this measure should take for each store is either all days of the month such as 31 days in January if the store opened before January OR the difference between end of month and open date if the store opened in the same month.
I tried the following measures:
Calculated Open Date = LASDATE(Store[Open Date])
Days Open = Calculate(INT(LASTDATE(Calendar[Date]) - [Calculated Open Date],
FILTER(Store, [Calculated Open Date] <= MAX(Calendar[Date]))