Forum Discussion
Naveen_SV
5 years agoHelper IV
difference between week values
Hello All,
How to get the difference between two weeks, below is the example
1 Reply
- DataInsightsSuper User
Try this solution. In this example, the data table is WeekDiff.
Create calculated table:
WeekDiffDates = VALUES ( WeekDiff[Date] )Create a relationship between WeekDiffDates and WeekDiff.
Create measures:
Count of Country = COUNT ( WeekDiff[Country] ) Difference = VAR vDate = MAX ( WeekDiffDates[Date] ) VAR vCurrentCount = [Count of Country] VAR vPrevDate = CALCULATE ( MAX ( WeekDiffDates[Date] ), WeekDiffDates[Date] < vDate ) VAR vPrevCount = CALCULATE ( [Count of Country], WeekDiffDates[Date] = vPrevDate ) VAR vResult = vPrevCount - vCurrentCount RETURN vResultIn the matrix, columns should be WeekDiffDates[Date]: