Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Line graph, add second line with last week's data?

I have a line graph that displays speed for the past 7 days. How do I add a second line that shows speed for the same days of the previous week?

 

  • Hi Anonymous,

    My sample table:



    Please create measure using the formula below. Create a table visual to display the result, check if it's correct.

    speed for the same days of previous week = CALCULATE(SUM(Table1[speed]),DATEADD(Table1[Date],-7,DAY))




    Beside your "speed for the past 7 days" measure, then add it as value level in line Chart, we can add mutiple measure as value levels in line chart.


    Best Regards,
    Angelia


1 Reply

  • v-huizhn-msft's avatar
    v-huizhn-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Anonymous,

    My sample table:



    Please create measure using the formula below. Create a table visual to display the result, check if it's correct.

    speed for the same days of previous week = CALCULATE(SUM(Table1[speed]),DATEADD(Table1[Date],-7,DAY))




    Beside your "speed for the past 7 days" measure, then add it as value level in line Chart, we can add mutiple measure as value levels in line chart.


    Best Regards,
    Angelia