Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Two Unrelated Tables

Hi Guys,

I need help with below tables:

 

Objective: To calculate Inquiry/Qty from two different unrelated tables. Below are the tables. Entity is my Dummy company name, Qty is sales qty, Inquiry is # of issues we got. I am looking to calculate Inquiry/Qty.

 

Is there a way we can do this?

 

EntityQty
A2
B1
C4
D2
A5
G3
G1
E2
B4
D5
C

3

 

 

ENTITYINQUIRY
A1
B1
C1
D1
A1
G1
G1
E1
B1
D1
C1

 

Thanks

 

Rohit

  • Anonymous 

    I would recommend the solution suggested by SteveCampbell , but if you don't want to create a Dimension Table, you could try:

     

    Inquiry divided by Qty =
    CALCULATE( DIVIDE(SUM(table2[ [Inquiry]), SUM(table1 [Qty])), TREATAS(VALUES(table1[Entity]), table2[Entity]))

6 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Icon for Community Champion rankCommunity Champion

    Anonymous 

    I would recommend the solution suggested by SteveCampbell , but if you don't want to create a Dimension Table, you could try:

     

    Inquiry divided by Qty =
    CALCULATE( DIVIDE(SUM(table2[ [Inquiry]), SUM(table1 [Qty])), TREATAS(VALUES(table1[Entity]), table2[Entity]))

    • Giorgi1989's avatar
      Giorgi1989
      Icon for Advocate II rankAdvocate II

      Thank you immensely! This worked like a charm for my case as well! 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Both of you are great! Thanks a ton.

      • PaulDBrown's avatar
        PaulDBrown
        Icon for Community Champion rankCommunity Champion

        Anonymous 

        As much as I appreciate you marking my suggestion (which in reality is only a "plan b" compared to building a dimension table) as a solution, I still strongly recommend you follow SteveCampbell  suggestion. It will make life much easier!