Hello, as per the thread title, I am trying to produce a report which shows how many journeys per day our vans are doing from data built up from one row per individual journey.
I've been able to get a pivot table to perform this calculation by using Distinct Count of van registrations plus then the number of journeys. I'm now trying to get Power Query to perform this calculation but am struggling with the distinct count element.
My data is arranged like the table below -
With my final output I'd like to show -
When I've tried the Group By function in Power Query I am only able to show the total number of entries (so no "Valid Journey" filtering) and I'm not at all able to get a distinct calculation of vans. Power Query is very new to me and I can see the potential for what I want to do with it but just cannot get it to work as I want at the moment.
Thanks for any help.
I've been able to get a pivot table to perform this calculation by using Distinct Count of van registrations plus then the number of journeys. I'm now trying to get Power Query to perform this calculation but am struggling with the distinct count element.
My data is arranged like the table below -
Country | Registration | Van Type | Date | Valid Journey? |
England | ABC123 | Small | 1/5/20 | Y |
England | ABC123 | Small | 1/5/20 | Y |
Scotland | DEF123 | Small | 1/5/20 | Y |
England | ABC123 | Small | 2/5/20 | Y |
England | ZYX123 | Large | 2/5/20 | Y |
England | DFG991 | Large | 2/5/20 | Y |
England | DFG991 | Large | 2/5/20 | Y |
Scotland | DEF123 | Small | 2/5/20 | Y |
Scotland | DEF123 | Small | 1/5/20 | N |
With my final output I'd like to show -
Country | Van Type | Date | Number of distinct vans | Number of valid journeys |
England | Small | 1/5/20 | 1 | 2 |
Scotland | Small | 1/5/20 | 1 | 1 |
England | Small | 2/5/20 | 1 | 1 |
England | Large | 2/5/20 | 2 | 3 |
Scotland | Small | 2/5/20 | 1 | 1 |
When I've tried the Group By function in Power Query I am only able to show the total number of entries (so no "Valid Journey" filtering) and I'm not at all able to get a distinct calculation of vans. Power Query is very new to me and I can see the potential for what I want to do with it but just cannot get it to work as I want at the moment.
Thanks for any help.