Forum Discussion

PetrarteP's avatar
PetrarteP
Frequent Visitor
5 years ago

Sales Order Line fact to Invoice Line Fact model

Hi,

 

I would like to know what is the best practice to create model that combines sales orders and inovices.

Current state is that I have two fact tables „Sales Order Line“ and „Invice Line“ granularity on both is each line item. Both of them are in separate star schema where common dimensions are „Customer“, „Date“, „Product“ and each fact table is additionaly related to more dimension that are specific for each fact.

„Invoice Line“ fact table has attribute for „Sales Order Document“ and „Sales Order Line Item“

„Sales Order Line“ fact table has this two attributes too.

In theory this two facts should join over Sales Order Line attribute but I do't know is it better to

  1. Option create Dimension „Sales Order Line“ that will have arround 50 million records and join it to both facts
  2. Option Link this two facts directly with 1:* as one Sales Order Line can have multiple Invoice Lines

 

Thank you in advance.

Best regards,

Petra

3 Replies

  • PetrarteP , Ideally two facts should not join, not it is good to have such a big common dimension.

    What is requirement to join these two ? What expected output for which you need to join these two

    • PetrarteP's avatar
      PetrarteP
      Frequent Visitor

      Hi, 

       

      Basically users would like to slice the Invoice data over attributes/dimensions that are only on sales order (medical data like Surgeon, Patient, Procedure, contracts....). And in general check which sales orders ended with invoice and validate totals.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi PetrarteP ,

     

    Sorry for that the information you have provided is not making the problem clear to me.

    Please provide me with more details about your table and your expected output or share me with your pbix file after removing sensitive data.

     

    Best Regards,
    Eyelyn Qin