cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cosminc Member
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
Community Support Team

Re: relative evolution expression day vs same day previous week

Hi cosminc,

 

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
Community Support Team

Re: relative evolution expression day vs same day previous week

Hi cosminc,

 

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)

1.PNG2.PNG 

 

Regards,

Jimmy Tao

cosminc Member
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
Community Support Team

Re: relative evolution expression day vs same day previous week

Hi cosminc,

 

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

cosminc Member
Member

Re: relative evolution expression day vs same day previous week

Thanks!
Cosmin