Forum Discussion
Calculating % Change between selected periods
- Anonymous7 years ago
Thanks! I ended up doing something pretty similar to that. Mine looked like this:
Total Sales Period 1 = CALCULATE(SUM(Table1[Total Sales]), DATESINPERIOD(Table1[Date].[Date],MAX(Table1[Date]),-22,DAY) )
Total Sales Period 2 = CALCULATE(SUM(Table1[Total Sales]), DATESINPERIOD(Table1[Date].[Date],MIN(Table1[Date]),22,DAY) )
Sales Difference = [Total Sales Period 2] - [Total Sales Period 1]
% Change = DIVIDE([Sales Difference], [Total Sales Period 2])
Hi Anonymous
You may try to create a measure like below:
FirstPeriod =
CALCULATE (
SUM ( Table1[Total Sales] ),
FILTER (
Table1,
Table1[Date]
IN {
VALUE ( "9/22/18" ),
VALUE ( "9/29/18" ),
VALUE ( "10/06/18" ),
VALUE ( "10/13/18" )
}
)
)SecondPeriod=CALCULATE(SUM(Table1[Total Sales]),FILTER(Table1,Table1[Date] in { VALUE("5/26/18"), VALUE("6/02/18"),VALUE("6/09/18"), VALUE("6/16/18")}))% = DIVIDE ( [SecondPeriod] - [ FirstPeriod], [ FirstPeriod] )
Regards,
Cherie
- Anonymous7 years agoNot applicable
Thanks! I ended up doing something pretty similar to that. Mine looked like this:
Total Sales Period 1 = CALCULATE(SUM(Table1[Total Sales]), DATESINPERIOD(Table1[Date].[Date],MAX(Table1[Date]),-22,DAY) )
Total Sales Period 2 = CALCULATE(SUM(Table1[Total Sales]), DATESINPERIOD(Table1[Date].[Date],MIN(Table1[Date]),22,DAY) )
Sales Difference = [Total Sales Period 2] - [Total Sales Period 1]
% Change = DIVIDE([Sales Difference], [Total Sales Period 2])
- v-cherch-msft7 years agoMicrosoft Employee
Hi Anonymous
Glad to hear it has been solved, please accept your answer as solution, that way, other community members will easily find the solution when they get same issue.
Regards,
Cherie