Forum Discussion

Alice_Cooper's avatar
Alice_Cooper
Helper II
3 years ago

Working With Dates - Un Related Dataset

 Hi there,

 

(Updated File Here: https://we.tl/t-Fzow7DHead)

 

Here is my problem... I will keep it simple as I am trying to understand the concept .... I have a dataset that has (End Of Month Report Period), (Lease Start Date), (Lease End Date) and (Suburb). The data is structured such that you can have multiple properties for the (End Of Month Report Period). 

 

So I have loaded the csv file, once as is and the second time only selecting the End Of Month Report Period, renamed to (EOMPRT)  and eliminating all duplicates. So I get two datasets, ALLDATA and EOMRPT.

 

I setup three visuals ... One with ALLDATA in Table, The Slicer for EOMRPT in list form, I then have a card that Displayes the Selected EOMRPT ... this is a new measure 

NM-SEOMRPT = SELECTEDVALUE(EOMRPT[EOMRPT])
 
Now the tables are not related ... I want to be able to claculate the following measures:
 
 NM_Lease_Start_Date_As_At_EOMRPT =IF (ALLDATA[Lease Start Date] < [NM-SEOMRPT],1,0)
 NM_Lease_End_Date_As_At_EOMRPT =IF (ALLDATA[Lease End Date] < [NM-SEOMRPT],1,0)
 
I get an error in Dax?
 
I tried using (Min(ALLDATA[Lease End Date]) but the calculation is incorrect ...
 
 
Please advise as to what I am doing wrong ...?
 

 

 
EOMRPT
31/07/2022
31/08/2022
30/09/2022
30/11/2022
31/01/2023
28/02/2023
31/03/2023
30/04/2023
31/05/2023
30/06/2023
31/07/2023
31/08/2023
30/09/2023
 
ALLDATA
End of Month Report PeriodLease Start DateLease End DateSuburb
31/07/2022 0:0010/07/2022 0:0010/01/2023 0:00BUNDALL
30/11/2022 0:0022/11/2022 0:0022/05/2023 0:00ROCKHAMPTON CITY
31/01/2023 0:005/01/2023 0:005/07/2023 0:00BEENLEIGH
31/07/2022 0:007/07/2022 0:007/07/2023 0:00SURFERS PARADISE
31/08/2022 0:002/08/2022 0:002/08/2023 0:00SPRING HILL
31/08/2022 0:005/08/2022 0:005/08/2023 0:00NEW FARM
30/09/2022 0:001/09/2022 0:001/09/2023 0:00NORTH WARD
31/03/2023 0:001/03/2023 0:001/09/2023 0:00CAPALABA
31/03/2023 0:002/03/2023 0:002/09/2023 0:00CHERMSIDE
31/03/2023 0:004/03/2023 0:004/09/2023 0:00CHERMSIDE WEST
30/09/2022 0:009/09/2022 0:009/09/2023 0:00SMITHFIELD
30/09/2022 0:0015/09/2022 0:0015/09/2023 0:00RAILWAY ESTATE
31/05/2023 0:005/05/2023 0:005/11/2023 0:00LEICHHARDT
30/06/2023 0:001/06/2023 0:001/12/2023 0:00BEENLEIGH
30/06/2023 0:002/06/2023 0:002/12/2023 0:00LEICHHARDT
31/07/2023 0:003/07/2023 0:003/01/2024 0:00INALA
31/01/2023 0:004/01/2023 0:004/01/2024 0:00WOODEND
31/07/2023 0:004/07/2023 0:004/01/2024 0:00RAILWAY ESTATE
31/01/2023 0:0010/01/2023 0:0010/01/2024 0:00SURFERS PARADISE
31/08/2023 0:001/08/2023 0:001/02/2024 0:00NORTH WARD
31/08/2023 0:002/08/2023 0:002/02/2024 0:00RAILWAY ESTATE
30/09/2023 0:001/09/2023 0:001/03/2024 0:00RAILWAY ESTATE
31/03/2023 0:005/03/2023 0:005/03/2024 0:00CAPALABA
30/04/2023 0:001/04/2023 0:001/04/2024 0:00INALA
30/04/2023 0:001/04/2023 0:001/04/2024 0:00LEICHHARDT
31/05/2023 0:002/05/2023 0:002/05/2024 0:00SURFERS PARADISE
31/05/2023 0:004/05/2023 0:004/05/2024 0:00BEENLEIGH
30/11/2022 0:0011/11/2022 0:0011/05/2024 0:00RAILWAY ESTATE
31/07/2023 0:002/07/2023 0:002/07/2024 0:00CAPALABA
28/02/2023 0:002/02/2023 0:002/08/2024 0:00BEENLEIGH
28/02/2023 0:004/02/2023 0:004/08/2024 0:00LEICHHARDT
31/07/2022 0:005/07/2022 0:001/07/2025 0:00SURFERS PARADISE
 

2 Replies