Forum Discussion

jcloss13's avatar
jcloss13
Frequent Visitor
8 years ago
Solved

Issue with using a lookup table in calculation.

Good Morning,    I feel like this issue should be easily solved but I can't figure it out.    I have two tables, Table A and Table B. Table A has the detail record and the number of transactions...
  • Ashish_Mathur's avatar
    8 years ago

    Hi,

     

    The mistake you are committing is that you are creating a relationshop from Table A to Table B.  There are two ways to go about solving this problem:

    1. Create a master table of all unique Locations from Table A and table B (let's call that new table Table C) [This master table can be create by appending Table A and Table B, removing all column expcet Location and then removing duplicated form the location column].  Then create a relationshop from Table A to Table C and Table B to Table C.  After this a simple SUM measure will work as expected.  Remember to drag location from Table C in your visual
    2. If you do not wish to create Table C as proposed above, you can use the RELATEDTABLE function in Table B (after creating a relationshop from Table A to Table B).  In a calculated column in Table B, enter this formula

     

    =SUMX(RELATEDTABLE(location_time),location_time[Transaction time])

     

    Now create your visual from Table B.