Forum Discussion

negro57's avatar
negro57
New Member
9 years ago
Solved

Weekly kilometers

I have a table where I register the kilometers that have the vehicles, I want to know the kilometers that traveled, subtracting the settlers the previous week and the settled ones this week.

What I need is to know the weekly kilometers traveled and to be able to compare with the routes in the previous weeks
Sorry for my english, I hope you understood me, thank you

  •  

    negro57

     

    create a calculated colum:

     

    KRecorridosP =
    CALCULATE (
        SUM ( Table1[Kilometros] ),
        FILTER ( ALLEXCEPT ( Table1,Table1[Dominio] ), Table1[Fecha] = EARLIER ( Table1[Fecha] ) - 7 )
    )

     

     

     

6 Replies

  • Hi negro57,

     

    Could you please share your data sample or data structure and your expectation as picture? so I could quickly figure out and propose solution.:smileyvery-happy: 

    • negro57's avatar
      negro57
      New Member

      I need in each row to calculate the number of km made by the vehicle from the previous load

      • Vvelarde's avatar
        Vvelarde
        Community Champion

         

        negro57

         

        create a calculated colum:

         

        KRecorridosP =
        CALCULATE (
            SUM ( Table1[Kilometros] ),
            FILTER ( ALLEXCEPT ( Table1,Table1[Dominio] ), Table1[Fecha] = EARLIER ( Table1[Fecha] ) - 7 )
        )