Forum Discussion
Filter two dates and userelationship
- 4 years agoIf you want the total of jobs started and submitted in the same mdate range thencreate an active 1:M relationship from Calendar[date] to yourtable[Submit date].Then assuming that submit dates cant be less that the Job date,create this measure ....Added and Submitted =// get max calendar dates for the contextVAR maxdate = MAX('Calendar'[Date])//create subset of records in the date rangeVAR mysubset = FILTER( yourtable, yourtable[Submit date] <= maxdate)RETURN// get total for subsetCOUNTROWS(mysubset)Drag the calender date to your slicer or the table visual (dont use the yourtable dates).Then drag Added and Submitted to your table visualHere is an example using Order Date and Despatch Date with inactoive relationships but the logic is exactly the same as Job Added and Client Submitetd date. Plus it is much better for me to teach you how to DIY, rather than just build a solution.Now please help me with kudos and click the thumbs up and accept as solution button. Thanks 😎
You need to use "role play" inactive relationships.
They are called role play because you one for Jobs Added and another for Client Submissions.
Please click here for an example solution and instructions
I helped you now please help me with kudos.
Please click the thumbs up and accept as solution button.
Thanks ! 😎
- Fro88er4 years agoHelper IV
This is helpful thanks, however this is not a Job date vs Submission date. Is it possible to filter both dates simultaneously? Meaning I have Job and Job date. I also have Job Submission and Submission date. When I filter the Job Date (active relationship to date calendar), it filters the Jobs in that date range (good), and I also need the Job Submissions in that date range only on those Jobs. Basically, I only want to see submissions on those jobs in that range. Currently, I am pulling submissions on those jobs past the date range, which I don't want.
- speedramps4 years agoSuper UserIf you want the total of jobs started and submitted in the same mdate range thencreate an active 1:M relationship from Calendar[date] to yourtable[Submit date].Then assuming that submit dates cant be less that the Job date,create this measure ....Added and Submitted =// get max calendar dates for the contextVAR maxdate = MAX('Calendar'[Date])//create subset of records in the date rangeVAR mysubset = FILTER( yourtable, yourtable[Submit date] <= maxdate)RETURN// get total for subsetCOUNTROWS(mysubset)Drag the calender date to your slicer or the table visual (dont use the yourtable dates).Then drag Added and Submitted to your table visualHere is an example using Order Date and Despatch Date with inactoive relationships but the logic is exactly the same as Job Added and Client Submitetd date. Plus it is much better for me to teach you how to DIY, rather than just build a solution.Now please help me with kudos and click the thumbs up and accept as solution button. Thanks 😎
- Fro88er4 years agoHelper IV
I see where you are going. Unfortunatly, this solution does not work because there is an inactive relationship between Jobs and JobSubmits by JobOrderID (you can see this in the PBIX file I shared). Both have dates, the primary being Jobs is the one joined to the date calendar. I tried the below and is not returning a value, but also not throwing an error.
Client Submission - Dis 2 =VAR _MaxDate = MAX(DimCalendar[Date])ReturnCALCULATE([Client Submission],FILTER(FactJobSubmission, FactJobSubmission[ClientSubmissionDateMod] <= _MaxDate),USERELATIONSHIP(FactJobSubmission[jobOrderID],'FactJobs'[jobOrderID]))