Forum Discussion

YBavré's avatar
YBavré
Frequent Visitor
3 years ago

NATURALINNERJOIN

Hi, I have created two tables:

_Table_SE_Only = CALCULATETABLE(VALUES(ENHANCED_CKI_CUSTOMER[Enterprise_Nbr]), filter(ENHANCED_CKI_CUSTOMER,ENHANCED_CKI_CUSTOMER[Cust_Segm] = {"Independent"}))
and
_Table_ORG_Only = CALCULATETABLE(VALUES(ENHANCED_CKI_CUSTOMER[Enterprise_Nbr]), FILTER(ENHANCED_CKI_CUSTOMER,ENHANCED_CKI_CUSTOMER[Cust_Segm] IN {"IVSE", "VSE", "SME", "Mid-Market", "Large Enter"}))
So I now have two tables with 1 column, being "Enterprise_Nbr" in both tables
 
I want to count the number of common "Enterprise_Nbr" from both tables.
So I used 
Common = NATURALINNERJOIN(_Table_SE_Only, _Table_ORG_Only)
But I get the error message NATURALINNERJOIN requires at least one common join column
 
I don't understand what I'm doing wrong. Can anyone help? Thanks.

Or is there another way to get the result I need?

3 Replies

  • v-jialluo-msft's avatar
    v-jialluo-msft
    Icon for Community Support rankCommunity Support

    Hi YBavré,

     

    Can you provide sample data, providing sample data can solve the issue faster.

     

    Best Regards,

    Gallen Luo

  • v-jialluo-msft's avatar
    v-jialluo-msft
    Icon for Community Support rankCommunity Support

    Hi YBavré ,

     

    NATURALINNERJOIN DAX Function:Joins the Left table with right table using the Inner Join semantics.

     

    Based on your description, I think you can use the union function and then use the count function to count each row in the table:

    Common = UNION(_Table_SE_Only, _Table_ORG_Only)
    
    Count = CALCULATE(COUNT('Common '[Enterprise_Nbr]),FILTER(ALL('Common '), 'Common '[Enterprise_Nbr]= MAX('Common '[Enterprise_Nbr])))

     

    NATURALINNERJOIN - Microsoft Power BI Community

     

     

    Best Regards,

    Gallen Luo

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

    • YBavré's avatar
      YBavré
      Frequent Visitor

      Hi, thank you for your reply.

      Unfortunatelly it doens't function the count measure returns 1 as result, not the total count.