Forum Discussion

CBloome77's avatar
CBloome77
Frequent Visitor
1 year ago
Solved

Calculating Rental $'s per day on a calendar table, using a start date column

Greetings.     I have a list of rental vehicles with the columns:  Asset#, Rental Start Date, and Rental $ per day.  I have also created a Calendar table using the CALENDARAUTO function.   What ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi CBloome77 

     

    Please make sure that no relationship has been established between your Calendar and RentalVehicles table.

    I'm assuming TODAY() as the Rental End Date, if you have a Rental End Date column in your data, just use it instead of TODAY().

    1. Create a Rental End Date column in your RentalVehicles table:

     

    Rental End Date = TODAY()

     

    2. Create a measure to calculate total rental  $ per day:

     

    TotalRentalPerDay = 
    CALCULATE(
        SUM('RentalVehicles'[Rental $ per day]),
        FILTER(
            'RentalVehicles',
            'RentalVehicles'[Rental Start Date] <= MAX('Calendar'[Date]) &&
            'RentalVehicles'[Rental End Date] >= MIN('Calendar'[Date])
        )
    )

     

     

     

    Best Regards,
    Jarvis Tang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.