Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Create Relationship Between 2 Tables

I need to create relationship between the 2 tables below to create same measure in both tables:

  1. Exception Summary table - (measure: % parcels with an Exception scan = SUM(NUM_OF_PARCELS_WITH_EXCP_SCAN) / SUM(NUMBER_OF_PARCELS_NOT_ON_TIME)
  2. Exception Detail table - (measure: % parcels with an Exception scan = COUNT(*) / NUMBER_OF_PARCELS_NOT_ON_TIME)

The NUMBER_OF_PARCELS_NOT_ON_TIME column is only present in table 1 but not table 2 so how do I create relationship to use this column in table 2 measure?

Here is the pbix file for reference.

  • Hi, Anonymous 

     

    It’s my pleasure to answer for you.

    According to your description, if you only want to create a measure with two column in different tables, it can be used directly.

    Like this:

    Measure = DIVIDE(SUM('Exception Summary'[NUM_OF_PARCELS_WITH_EXCP_SCAN]),SUM('Exception Summary'[NUMBER_OF_PARCELS_NOT_ON_TIME]))
    
    Measure 2 = DIVIDE(SUM('Exception Detail'[COUNT(*)]),SUM('Exception Summary'[NUMBER_OF_PARCELS_NOT_ON_TIME]))

    And you can’t define two measures with the same name. If you don’t want to calculate total, please add some requirements,so we can help you.

     

    If it doesn’t solve your problem, please feel free to ask me.

     

    Best Regards

    Janey Guo

     

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

3 Replies

  • Anonymous , Not very clear. you can use a measure like one of the two

    sum('Excep Detail'[NUMBER_OF_PARCELS_NOT_ON_TIME])
    sum('Excep Summary'[NUMBER_OF_PARCELS_NOT_ON_TIME])

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi amitchandak, sorry for the confusion. I have edited my initial post to clarify a bit more. Hope it makes sense.

      stevedep fyi if you have any thoughts?

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

    Hi, Anonymous 

     

    It’s my pleasure to answer for you.

    According to your description, if you only want to create a measure with two column in different tables, it can be used directly.

    Like this:

    Measure = DIVIDE(SUM('Exception Summary'[NUM_OF_PARCELS_WITH_EXCP_SCAN]),SUM('Exception Summary'[NUMBER_OF_PARCELS_NOT_ON_TIME]))
    
    Measure 2 = DIVIDE(SUM('Exception Detail'[COUNT(*)]),SUM('Exception Summary'[NUMBER_OF_PARCELS_NOT_ON_TIME]))

    And you can’t define two measures with the same name. If you don’t want to calculate total, please add some requirements,so we can help you.

     

    If it doesn’t solve your problem, please feel free to ask me.

     

    Best Regards

    Janey Guo

     

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