Forum Discussion

MagikJukas's avatar
MagikJukas
Resolver III
3 years ago
Solved

sum values from another table without relationship

Hello,

I have the following situation:

Table1: 

MaterialQty
SB340800

 

Table2:

ComponentsLvl Above
SB340SB330
SB330 

 

I want to create a measure that shows 800 associated to the components SB330.

 

the two tables do not have reletionship due to additional complexities of the model.

 

regards

 

 

  • Ok, I think I got it:
    I broke it up in two measure:

    M1=CALCULATE(SUM(table1[Qty]),Table1[Material] IN VALUES(Tabl2[Components]))
    M2 =CALCULATE(M1,ALL(Table2),Table2[Lvl Above] IN VALUES(Table1[Components]))

     

2 Replies

  • olgad's avatar
    olgad
    Resident Rockstar

    Hi, can you have inactive relationship between the two? Just create the relationship, but it shall be inactive.
    Then you can write a formula:
    Qty=

    CAlculate(Sum('Table1'[Qty]), USERELATIONSHIP('TAble1'[Material],'Table2'[Components]))
  • Ok, I think I got it:
    I broke it up in two measure:

    M1=CALCULATE(SUM(table1[Qty]),Table1[Material] IN VALUES(Tabl2[Components]))
    M2 =CALCULATE(M1,ALL(Table2),Table2[Lvl Above] IN VALUES(Table1[Components]))