Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Latest Date


EDIT - 
Latest Date by 2 ID columns.
Is that possible?
I tried to concatenate the columns, but got an error "end of the input was reached"

Please look for examples in message below.
Ta!


Hi All,

I am trying to return the latest date with the built in function.

I have 2 tables with relationship. Where Table1.id = Table2.id

I want for each Table2.id return latest Table1.date.

It is not working for me as expected.

Any ideas?

Cheers!

 

 

 

8 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I tried merging 2 tables but got different results and missing values in the columns.

    Not sure why.

     

    So I am trying to get latest date from T2 (Circle 3) according to T1,id (Circle1).

     

    The merge table between Circle1 and Circle2 gives missing results than I have in the relationship and visuals created.

     

    Cheers!

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous,

       

      You can try to add following calculate column to table 2 to get related table 1 id, then use these id to get correspond date and summary the max one:

      LastDate =
      CALCULATE (
          LASTNONBLANK ( Table1[Date], [Date] ),
          FILTER ( ALL ( Table1 ), Table1[ID] = EARLIER ( Table2[ID] ) )
      )


      Regards,

      Xiaoxin Sheng

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous

        Table 2 is just a connection table.

        All it conatins in IDs from table 1 and the related IDs from table 3.

        So I dont think I need to get the IDs from the table(s), as they are already there.

         

        I am still not able to filter and get the latest date record.

         

        Cheers!