Forum Discussion

vpnnm's avatar
vpnnm
Frequent Visitor
7 years ago
Solved

Help for calculating multiple fields of multiple table in many to many relationship!

Dear All,

Please help me with the situation as below:


 

 

 

 

 

 

 

 

 

 

 

 

Produce the table as below, however my measure for Total #APP looks wrong, and i spent many day searching without possible solution:

Result

 

 

 

 

Date Slide from the DISB table.

CMP_NM column from the LEADGEN table

 

 

 

 

 

 

 

My Dax code as follow:

Total #APP = CALCULATE(DISTINCTCOUNT(APP[APP_ID_C]),LEADGEN[REALNM_NO]<>BLANK())

Total #DISB = CALCULATE(DISTINCTCOUNT(DISB[agreementid]),LEADGEN[REALNM_NO]<>BLANK())

Total #LEAD = CALCULATE(COUNT(LEADGEN[CUST_NO]),ALLEXCEPT(LEADGEN,LEADGEN[CMP_NM]))

Your help are greatly appreciated.
Thank you so much,

  • Hi vpnnm,

     

    Try this one, please. Are you sure the result should be 2901? I would suggest you check them with a small dataset.

    Total #APP =
    CALCULATE (
        DISTINCTCOUNT ( APP[APP_ID_C] ),
        FILTER ( BRIDGE, BRIDGE[ID] <> BLANK () ),
        FILTER ( LEADGEN, LEADGEN[REALNM_NO] <> BLANK () )
    )
    

    Help-for-calculating-multiple-fields-of-multiple-table-in-many-to-many-relationship4

     

    Best Regards,

16 Replies

  • vpnnm's avatar
    vpnnm
    Frequent Visitor
    Please help or point me to some dỉection so i can figure it out. Tks
    • Stachu's avatar
      Stachu
      Icon for Community Champion rankCommunity Champion

      do numbers change  to correct ones if you switch the relationship to single direction for APP and DISB tables?

      • vpnnm's avatar
        vpnnm
        Frequent Visitor

        Unfortunately, result is same as before.

        ps. The bridge table is appended of DISB and APP.