Home > Back-end >  DAX Lookup function in Dax sometimes working
DAX Lookup function in Dax sometimes working

Time:12-23

I have 2 Fact tables that aren't related. I need to create a calc column "vlookup" style from table 1 to table 2 it works sometimes... on the same customer it will and will not work. how?!

enter image description here

all the conditions for the lookup are the same. how am i getting a blank value where clearly I should get "VirtualPay2"?

CodePudding user response:

If you need measure

measure =
CALCULATE (
    MAX ( t1[Gateway] ),
    TREATAS (
        SUMMARIZE ( t2, t2[PSP_ID], t2[pin/login], t2[Date], t2[Hour], t2[amount] ),
        t1[PSP_ID],
        t1[pin/login],
        t1[Date],
        t1[Hour],
        t1[amount]
    )
)

if you need a calculated column

CalculatedColumn =
CALCULATE (
    CALCULATE (
        MAXX ( t1, t1[Gateway] ),
        TREATAS (
            SUMMARIZE ( t2, t2[PSP_ID], t2[pin/login], t2[Date], t2[Hour], t2[amount] ),
            t1[PSP_ID],
            t1[pin/login],
            t1[Date],
            t1[Hour],
            t1[amount]
        )
    )
)
  • Related