Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Relationships

Hello, I have an existing column that is an ID for my customers. I am trying to make it to where my customer ID can be interchangable with the actual name of my customer. I tried to make a relations...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  Anonymous ,

    I created some data:

    Table1:

    Table2:

    Here are the steps you can follow:

    You can add Index to both tables in power query.

    This way you have a relationship between your two tables.

    You can then create computed columns:

    Column =
    CALCULATE(SUM('Table1'[ID]),FILTER(ALL(Table1),'Table1'[Index]='Table2'[Index]))

    Or create measure.

    Measure =
    CALCULATE(MAX('Table2'[customer name]),FILTER(ALL(Table2),'Table2'[Index]=MAX('Table1'[Index])))

    Please click here for the pbix file

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly