Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Relationship between two tables

Hi Power BI Community! I am frustraded....I knew how to connect two tables but know I run into a problem I have two tables with suppliers. One table has the amount of supplies and the other the...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

     

    Based on your description, I created some sample data and did a test. Here are my test tables.

     

    I create two measures to do some calculations.

    Measure =
    VAR x1 =
        ADDCOLUMNS (
            SUMMARIZE ( 't1', t1[ID], t1[amount of supplies] ),
            "t2", LOOKUPVALUE ( t2[amount of supplies], t2[ID], [ID] )
        )
    RETURN
        MAXX (
            FILTER ( x1, [ID] = SELECTEDVALUE ( t1[ID] ) ),
            [amount of supplies] / [t2]
        )
    
    Measure 2 =
    MAX ( 't1'[amount of supplies] ) / MAX ( 't2'[amount of supplies] )
    

    Result:

    Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please share some sample data and the expected result to have a clear understanding of your question? I can do some tests for you.

    You can save your files in some cloud sharing platforms and share the link here. (screenshots are as well)

    How to provide sample data in the Power BI Forum - Microsoft Power BI Community

     

    Best Regards,

    Yuna