Forum Discussion

wrwillits's avatar
wrwillits
Helper III
9 years ago
Solved

averagex

I am trying to calcualte the daily average of flight hours for an aircraft that has multiple flights per day for a number of days (the aircraft doesn't fly every day). I am first summing the hours fl...
  • Vvelarde's avatar
    Vvelarde
    9 years ago

    wrwillits

     

    Hi, Try this please:

     

    1. Create a measure to count the days between the range selected in Date Slicer (Plus 1)

     

     

    DayBetweenFirst&LastDaySelected+1 =
    DATEDIFF ( MIN ( AirCraft[Date] ), MAX ( AirCraft[Date] ), DAY ) + 1

     

    2. Create a measure to calculate the Average Daily Hour

    AverageDailyHour =
    DIVIDE ( SUM ( AirCraft[Hours] ), [DayBetweenFirst&LastDaySelected+1] )