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
Anonymous
Not applicable

Same day Previous week

IMG_20200114_062759_0.jpg

tbl_dtbtxclplwp
11/9/20198903455
11/10/2019232142159
11/11/20194455127170
11/12/2019433113133
11/13/2019345615869
11/14/201944510738
11/15/20193366171
11/16/2019876731113
11/17/201976665158125
11/18/2019665101118
11/19/20196778107129
11/20/20195446567971
11/21/2019666445510130
11/22/20195555652137
11/23/20197787729124
11/24/201977878127137
11/25/201955667114135
11/26/20195667100115
11/27/201956889859
11/28/2019889889624
11/29/2019777651183
11/30/2019789843121
12/1/20196777131116
12/2/20196678987110
12/3/2019788873494
12/4/20196774962
12/5/201967768431
12/6/201999456128
12/7/20195544437133
12/8/2019445488107
12/9/20196666689137
12/10/20196676738229
12/11/2019655419767
12/12/201956671283334
12/13/2019665591323
12/14/20195566912334
12/15/201976668855
12/16/20196666105667
12/17/20196677654445
12/18/20197677619556
12/19/201977666128887
12/20/20196677109766
12/21/20195665121877
12/22/2019554410989

 

So I want to show a line graph with it, where the x-axis would be holding the dates and the values on y-axis with two lines. One line will be trending for the current week and the other line should be for any past week selected(I want in a suitation whereby I can select any past week, it can 4weeks back or 2weeks or 3weeks etc and see the trend of what we have for that week as compared to the current week). I don't know if there is a better way you think this could b achieved.

 

Thank you very much.

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

@Anonymous actually measure used by @Mariusz will work for you if you add minus for the day offset (here adjusted for your table)

Measure = 
CALCULATE(
    SUM( 'Table'[lwp] ),
    DATEADD( 
        'Table'[tbl_dt], 
        - MAX( 'Week Slicer'[Week No] ) * 7, 
        DAY 
    )
)


Capture.PNG

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

7 REPLIES 7
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

Please see the attached file with a solution.

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

 

Anonymous
Not applicable

Hi

@Mariusz 

I can see that you are suming the values.

I don't want to sum the values, I want in a way whereby I select a day, it will show me the trend values for each day for that week, and also show me the values that we have for those days previous week. 

Stachu
Community Champion
Community Champion

Can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).

Column1Column2
A1
B2.5

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

@Stachu  I have added some annoymized data.

 

So all I want to do is same day previous weeks.

 

As I stated earlier

Stachu
Community Champion
Community Champion

the days in the X axis are always showing just current week, correct? So looking at the report today (22-01-2020), with 3 weeks reference, the chart would be following:

X axis - dates from 16-01-2020 till 22-01-2020

Current week - values for dates 16-01-2020 till 22-01-2020

PreviousWeek - value for 26-12-2019  shown in 16-01-2020 x axis, 27-12-2019  shown in 17-01-2020 x-axis, etc

do I understand it correctly?



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

@Stachu 

X-axis will show the current week with the line trend, that is 17/01/2020 to 23/01/2020, while the other line trend hovering over will show previous week like from 10/01/2020 to 16/01/2020(although this can be for last week, last 2weeks i.e 03/01/2020 to 09/01/2020) etc.

 

Hope I am clear enough.

 

Thanks for your input thus far.

Stachu
Community Champion
Community Champion

@Anonymous actually measure used by @Mariusz will work for you if you add minus for the day offset (here adjusted for your table)

Measure = 
CALCULATE(
    SUM( 'Table'[lwp] ),
    DATEADD( 
        'Table'[tbl_dt], 
        - MAX( 'Week Slicer'[Week No] ) * 7, 
        DAY 
    )
)


Capture.PNG

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

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.

Top Solution Authors