Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

CALCULATE with NATUALLEFTOUTERJOIN

I am struggling with following:

Table A:
Key, Name
A, John
B, Jane
C, Ruby

Table B:
Key, Age
A, 24
C, 30

I have following code:

EVALUATE
ADDCOLUMNS (
    NATURALLEFTOUTERJOIN ( A, B ),
    "Test", CALCULATE ( MAX ( A[Key] ) )
)


Result:
Key, Name, Age, Test
A, John, 24, A
B, Jane, null, null
C, Ruby, 30, C

And for me expected result would be:
Key, Name, Age, Test
A, John, 24, A
B, Jane, null, B
C, Ruby, 30, C

!!!Note!!! That formula for calculating column [Test] will be put in measure.

1 Reply