I have two source systems where one system keeps track of the daily data which has entry for each day for the vehicle is driven. It has the number of hours driven/day and the location the car is driven. And there are multiple car models. There can be days when there is no entry for that car. In such a case, it should not filter the dates column, but should show blank where there is no entry. For example, for Toyota, on Jan2nd,3rd,10th,16,17,27, it should show blank instead of not showing that record in the table. Same with Honda. I understand this can be achieved using powerquery merge, but my tables are already in data model. Is there a DAX to do that outer join?
And, for the RangeofHours, the information this table has is for a range of dates for which the car should be at a particular location. And, I have a question on how to create the relationship between the date table and this RangeofHours table. When you have a table that has a range of hours from start date to end date, how to connect with the date table?
The problem I am trying to solve is I have to compare if the car is driving the target number of hours that it should (defined in the RangeofHours table).
This is done by calculating the number of hours the car drove on a daily basis from DailyHours table, and its location for the number of days that are selected in the date table and also pull the TargetDriveTime and RangeofCarLocation from RangeofHourse table side by side.
Also, in another tab show for the dailydrivetime,dailylocation, targetdrivetime,RangeofCarLocation without the date column, but result showing with the date slicer for a duration selected.
Say the user selected a date range from 1/10/2021 to 1/20/2021, The total number of working days will be 8 days. I have to calculate the total drive time for each specific car (individually to be able to filter by car with a filter) within the date range in the date slicer selected for the different locations that have a start and end date. But, should display daily TargetDrivetime for weekdays and should be blank for weekends if looking on a daily basis.
For location(RangeofCarLocation) 121, Even though its start date is in Oct 2020, the date slicer is from 1/10/2021, and end date is within the date range selected and the number of working days will be 8.
So, for the dates 16th,17th, the DailyCarlocation should be blank,and DailyDrivetime should show blank. And the same thing with RangeofCarLocation from RangeofHours table.
I tried multiple ways to create the relationships and creating the dax for calculating the hours and hoping I get help from this amazing Enterprise DNA forum. Attaching the pbix file as well. Thank you in advance.
EDNAFile.pbix (93.7 KB)