Forum Discussion

azalazi's avatar
azalazi
New Member
2 years ago
Solved

Power pivot-Calculated Field- to return value correspond max date before date in row of main table

I need to return value from table2 for max date before the Date in table 1, 

below table shows the illustration

 

Table1 (Main Table)

DateIDVALUE
30-06-20239999???   it should return X1
30-08-20239999???   it should return B6

 

Table2

DateIDValue
01-05-20239999Y6
15-05-20239999X1
10-07-20239999B6

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi azalazi ,

     

    You can use Merge Queries.

    Merge like the following.

     

     

    Create a custom to filter the Date.1.

    Filter out the nulls.

    Group by as follows.

    Expand the All Rows column.

    Add another custom column to filter again.

     

    Remove the unneeded columns and you get the result.

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi azalazi ,

     

    You can use Merge Queries.

    Merge like the following.

     

     

    Create a custom to filter the Date.1.

    Filter out the nulls.

    Group by as follows.

    Expand the All Rows column.

    Add another custom column to filter again.

     

    Remove the unneeded columns and you get the result.

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.