Forum Discussion
rolf1994
9 years agoHelper II
Calculate value between two dates
Hi, i have the following tables in my data model (using directquery). I want to calculate the value in the ValueTable between the StartDate and EndDate. ValueTable: Date Value 25-2-2017 1 ...
- 9 years ago
Hi rolf1994,
You should be able to use the formula below to create a measure in this scenario, then show the measure on the Table/Matrix visual with PeriodTable[StartDate] and PeriodTable[EndDate] column. :smileyhappy:
Measure = CALCULATE ( SUM ( ValueTable[Value] ), FILTER ( ValueTable, ValueTable[Date] >= MIN( PeriodTable[StartDate] ) && ValueTable[Date] <= MAX ( PeriodTable[EndDate] ) ) )Regards
Greg_Deckler
9 years agoCommunity Champion
Column = CALCULATE(SUM(ValueTable[Value]),FILTER(ValueTable,ValueTable[Date]>PeriodTable[StartDate] && ValueTable[Date]<PeriodTable[EndDate]))