Forum Discussion
Counting value changes in given time period
- 5 years ago
Hi Anonymous
In the absence of your sample data, maybe you can measure like:
Measure = var this_week= CALCULATE( SUM([values]), FILTER( 'Table', 'Table'[Date]=thisweek // return date of this week )) var Last_week= CALCULATE( SUM([values]), FILTER( 'Table', 'Table'[Date]=thisweeek-7 // return date of last week )) return IF( this_week-Last_week>0, CONCATENATE("+",this_week-Last_week), this_week-Last_week )Best Regards,
Link
The expected output is to have a card (like in the mockup picture) that counts the amount the value has changed in the last 7 days. Essentially I want to count what the value was 7 days ago and count what the value is today, and then show what the difference is. (i.e. last week I had 42 requests, this week I had 51, so the output would be +9, if I had 42 requests last week, and only 40 requests this week, the output would be -2) Does that help clarify?
In regard to data that could be relevant for this, I only have the date the request was created and which status it is currently in (the seven statuses are shown in the mockup).
Thanks!
Hi Anonymous
In the absence of your sample data, maybe you can measure like:
Measure =
var this_week=
CALCULATE(
SUM([values]),
FILTER(
'Table',
'Table'[Date]=thisweek // return date of this week
))
var Last_week=
CALCULATE(
SUM([values]),
FILTER(
'Table',
'Table'[Date]=thisweeek-7 // return date of last week
))
return
IF(
this_week-Last_week>0,
CONCATENATE("+",this_week-Last_week),
this_week-Last_week
)
Best Regards,
Link