Forum Discussion
Anonymous
4 years agoNot applicable
this week versus last week difference
I have a table below in which i wanted to calculate or get the difference from this week's count against last week. below is a sample table output that i wanted to achieve. i wanted to get a dax form...
- 4 years ago
Hi, Anonymous
Please try formula like:
Week Difference = VAR last_week = CALCULATE ( MAX ( 'Table'[WEEKENDINGSAT] ), FILTER ( ALL ( 'Table' ), 'Table'[WEEKENDINGSAT] < MAX ( 'Table'[WEEKENDINGSAT] ) ) ) VAR _count_of_lastweek = CALCULATE ( [CountOfECMs1], FILTER ( ALL ( 'Table' ), 'Table'[WEEKENDINGSAT] = last_week ) ) RETURN IF ( ISBLANK ( _count_of_lastweek ), BLANK (), [CountOfECMs1] - _count_of_lastweek )Best Regards,
Community Support Team _ Eason
v-easonf-msft
Community Support
4 years agoHi, Anonymous
Please try formula like:
Week Difference =
VAR last_week =
CALCULATE (
MAX ( 'Table'[WEEKENDINGSAT] ),
FILTER (
ALL ( 'Table' ),
'Table'[WEEKENDINGSAT] < MAX ( 'Table'[WEEKENDINGSAT] )
)
)
VAR _count_of_lastweek =
CALCULATE (
[CountOfECMs1],
FILTER ( ALL ( 'Table' ), 'Table'[WEEKENDINGSAT] = last_week )
)
RETURN
IF (
ISBLANK ( _count_of_lastweek ),
BLANK (),
[CountOfECMs1] - _count_of_lastweek
)
Best Regards,
Community Support Team _ Eason