Good day. I have a custom report that shows how many various flights our crew members have done over the course of the year. This data is shown with a Label.
To show this data, I've created few labels and a drop-down menu to select the crew member. Upon selection of the crew member, the data will show how many flight hours, miles and total flights that employee has done in the year.  To verify that PowerApps is displaying the correct information, I have an Excel spreadsheet with a series of Pivot tables.  Here is the information that I’m required to have:
- Total Flights
- Total Hours
- Total Mileage
- Total Medevac Flights
- Total Training Flights
- Total Medevac Hours
- Total Training Hours.
Each crew member has different a different role during a flight. Some are assigned to Crew Member 1, some are assigned to Crew Member 2, some are assigned to Crew Member 3. Â There are a few employees who can only be Crew Member 1. The same goes for Crew Member 2 and 3, which are the same job.
What Im having trouble with, is creating a formula that searches the table and gives me the correct amount of flights, hours and miles. Here is what I have so far:
Total flights:
CountRows(Filter('[dbo].[CmStats]', Cm1 = StatDropDown.Selected.Value && Cm2 = StatDropDown.Selected.Value && Cm3 = StatDropDown.Selected.Value))
Total hours:
Sum(Filter(ytdGal.AllItems, Cm1=StatDropDown.Selected.Value && Cm2=StatDropDown.Selected.Value && Cm3=StatDropDown.Selected.Value),FlightTime)
Total miles:
Sum(Filter(ytdGal.AllItems, Cm1=StatDropDown.Selected.Value && Cm2=StatDropDown.Selected.Value && Cm3=StatDropDown.Selected.Value),Mileage)
Total Flights of a specific flight:
CountRows(Filter('[dbo].[CmStats]', Cm1 = Cmdrop.Selected.Value,Cm2 = Cmdrop.Selected.Value, Cm3=Cmdrop.Selected.Value, MissionType = "Medevac"))
These formulas will display incorrect data when compared to my Excel spreadsheet. Is there a way that I can use an IF statement to better my formula?
v/r
Brendon