Forum Discussion
wrwillits
9 years agoHelper III
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...
- 9 years ago
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] )
Vvelarde
9 years agoCommunity Champion
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] )
wrwillits
9 years agoHelper III
It's working! Thanks for that.
Also, I'm still a bit confused at to why AVERAGEX wouldn't work. Were the missing dates causing the issue?