Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Using RELATED() across a bridge table?

I have two tables that are connected via a bridge table. What is the best approach to creating a measure that aims to multiply columns values from one table with a column from the table on the other side of the bridge? 

 

I've done plenty of SUMX(table, related()) functions with Many-to-One related tables but never with a bridge setup. 

  • Hi Anonymous 

    Measures below:

    sum_NRI = SUM(dAttributes[NRI])
    sum_oilvolume = SUM(fProduction[oilvolume])
    mutiply = [sum_NRI]*[sum_oilvolume]

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

6 Replies

  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi Anonymous 

    As tested, if i create examples below:

    It would support to create a measure with aggregation like:

    Measure = CALCULATE(SUM('Table 2'[return]),FILTER('Table 2','Table 2'[product]=MAX('Table 1'[product])))

     

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Here is my sample model: https://github.com/rstover/PowerBI 

       

      Bridge Model Example

       

      What I am trying to do is take the oilvolume from the fProduction table and multiply it by the bridge related NRI column from dAttributes

      • lbendlin's avatar
        lbendlin
        Super User

        you cannot use RELATED() for the reasons I stated. Use LOOKUPVALUE() instead

  • I think Related() only works if you pull fields from the 1 side table to the many side table.  That means you can't use it with bridge tables.

  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi Anonymous 

    Measures below:

    sum_NRI = SUM(dAttributes[NRI])
    sum_oilvolume = SUM(fProduction[oilvolume])
    mutiply = [sum_NRI]*[sum_oilvolume]

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.