Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cosminc
Post Partisan
Post Partisan

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

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

View solution in original post

4 REPLIES 4
v-yuta-msft
Community Support
Community Support

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

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

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

Thanks!
Cosmin

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.