cancel
Showing results for
Did you mean:
Highlighted
Member

## relative evolution expression day vs same day previous week

Hi all,

I have a data base with last 14 days and i want for the last 7 days to see in a graph the evolution versus same day from the first week

can you help me please with this issue? i'm stucked on it.

table example:

day                    value

7/19/2018              5

7/20/2018             11

...

7/26/2018          10

...

8/1/2018            3

result graph with all 14 days in it and 0% value for first 7 and from 26 jul (+100% vs 19 jul) and so on

Thanks a lot!

Cosmin

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: relative evolution expression day vs same day previous week

Hi

As a general solution, you can create a measure with some modification of the calculate column above and create a slicer to make user select date. Then replace DATE(2018, 7, 26) with SELECTEDVALUE(Table[Date]).

Regards,

Jimmy Tao

4 REPLIES 4
Community Support Team

## Re: relative evolution expression day vs same day previous week

Hi

To achieve your requirement, you can create two calculate columns using DAX below:

```Seven_days_ago_value =
VAR Seven_days_ago = Table1[day] - 7
RETURN
CALCULATE(MIN(Table1[value]), FILTER(ALL(Table1), Table1[day] = Seven_days_ago))

Compare = IF(Table1[day] >= DATE(2018, 7, 26), Table1[value] / Table1[Seven_days_ago_value], 0)```

Regards,

Jimmy Tao

Member

## Re: relative evolution expression day vs same day previous week

hi,

thanks a lot

2 things:

the source is variable, i saw you put in the second expression a constant date, wright?

`Compare = IF(Table1[day] >= DATE(2018, 7, 26), `

and i have also other dimensions which are filtered on report and imagine that my table is more complex: let's say your example multiplied (add a new column with salesmen - S1, S2, S3 similar but with value column different - each salesman have these 14 days data)

when i filter data for S1  i need to see a graph with evlolution

thanks!

Cosmin

Community Support Team

## Re: relative evolution expression day vs same day previous week

Hi

As a general solution, you can create a measure with some modification of the calculate column above and create a slicer to make user select date. Then replace DATE(2018, 7, 26) with SELECTEDVALUE(Table[Date]).

Regards,

Jimmy Tao

Member

Thanks!
Cosmin