Forum Discussion
Calculating MIN(Date) with data from three different tables...
I'm sorry amitchandak but I can't quite figure out what you're trying to tell me. The names you use in your example aren't the ones I gave in my description, and you refer to two tables while I spoke of three?
Try a new column in Dim_Details
StartDate =
if(
minx(filter(Fact_Keys, Fact_Keys[SK_Details]=Dim_Details[SK_Details]),Fact_Keys['SK_Date']) <date(2015,01,01)
,Dim_Details [BackupDate],minx(filter(Fact_Keys, Fact_Keys[SK_Details]=Dim_Details[SK_Details]),Fact_Keys['SK_Date']) )
- grggmrtn6 years ago
Post Patron
Hmm, this actually looks like is almost works. The resulting format is a bit off though, with some of the results looking like 20160105 (aka january 5, 2016) and others looking like 42374, 2958465, 42375.... The new column has a decimal datatype and changing it only brings error (system format exception)...
Maybe because your code doesn't refer to DIM_Date[Date] at all? The output is the key, not the date itself...
- amitchandak6 years ago
Super User
Get the min date in the column. Get its date using another formula from date table and compare it with min dates and then again apply for logic get BackupDate