Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

[DAX Measure] Referencing another table to add a calculated value

Hello All,

 

I am currently stuck with this use case below and would greatly appreciate any input.

 

Building a POC off of Azure Analysis Services so I have limitations around creating calcualted columns and M.

 

I have two data tables that look like below:

 

Origin Table

Id

Start X

Start Y

123

0

0

123

4

7

123

8

20

123

20

76

345

0

0

345

7

10

 

Parent Table

Id

Origin X

Origin Y

123

50

25

345

25

76

 

But would like to get the output below with DAX

 

Expected Dax Output

ID

New X

New Y

123

50

25

123

54

32

123

58

45

123

70

101

345

25

76

345

32

86

 

Can this actually be done on leveraging DAX?

 

 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello!

     

    I believe I found a reliable DAX formula for this. First, I assume that the Parent Table only contains each Id once. Therefore, we must first start by creating a one-to-many relationship from the Parent Table to the Origin Table by linking Ids.

     

    From there, we can use the following DAX formulas to create custom columns inside the Origin Table:

    New X = RELATED('Parent Table'[Origin X]) + [Start X]
    New Y = RELATED('Parent Table'[Origin Y]) + [Start Y]

    Hope this helps!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Sean, you are not able to add a calculated column, because this model is leveraging AAS. We are only able to create measures.