Forum Discussion

gadao's avatar
gadao
Frequent Visitor
1 year ago
Solved

Bring Last Value Based on Date

Hello folks,

 

I got myself struggling trying to solve a simple thing i think:

I have this little table here which tells me when a certain value starts to being used.

IndexValue
120
530
740
950

and the next one are the index table

1
2
3
4
5
6
7
8
9
10

I want a matrix like this one, a parallel in excel would be XLOOKUP with match mode set to -1.

120
220
320
420
530
630
740
840
950
1050
  • For your reference.

     

    Step 0: I use these data.

        

     

    Step 1: I merge these tables.


     

    Step 2: I expand 'Value' column.

     

    Step 3: I do 'Sort Ascending' on 'Index' column.

    [Before] 

    [After]

     

    Step 4: I do 'Fill Down' on 'Value.1' column.

    [Before]

    [After]

     

2 Replies

  • Please try to create below:

    ResolvedValue =
    VAR CurrentIndex = IndexTable[Index]
    RETURN
    MAXX(
    FILTER(
    ValueTable,
    ValueTable[Index] <= CurrentIndex
    ),
    ValueTable[Value]
    )

  • For your reference.

     

    Step 0: I use these data.

        

     

    Step 1: I merge these tables.


     

    Step 2: I expand 'Value' column.

     

    Step 3: I do 'Sort Ascending' on 'Index' column.

    [Before] 

    [After]

     

    Step 4: I do 'Fill Down' on 'Value.1' column.

    [Before]

    [After]