Forum Discussion
Anonymous
4 years agoNot applicable
Calculate measure with multiple dates
I am struggling with a calculation of measure with 2 dates. My table below has 2 dates. Trying to calculate sum of quantity by revision dates. My filter is on Calendar date which has an active ...
- 4 years ago
- 4 years ago
Hey Anonymous ,
next to the solution provided by Ashish_Mathur , here is another approach that only makes use of the tables
- Revision Table
- Calendar
Tom = var MAXSelectedDate = MAX('Calendar'[Date] ) var SelectedYear = YEAR( MAXSelectedDate ) var SelectedMonth = MONTH( MAXSelectedDate ) var EoMofSelectedDate = EOMONTH( MAXSelectedDate , 0 ) var __AllPurchDatesInSelectedMonth = DATESBETWEEN( 'Calendar'[Date] , DATE( SelectedYear , SelectedMonth , 1) , EoMofSelectedDate ) return CALCULATE( SUM( 'Revision Table'[Quantity] ) , 'Revision Table'[Purch Date] IN __AllPurchDatesInSelectedMonth )A little screenshot:
Hopefully, this provides what you are looking for.
Regards,
Tom
Ashish_Mathur
4 years agoSuper User