Forum Discussion

kazuma6666's avatar
kazuma6666
Helper II
4 years ago
Solved

Using a date table to filter makes it impossible to keep 1 to M relationship

Hello,   I'm trying to get the sums of amounts found in invoices and credit notes for the memberships, as well as their nominal codes (internal label for grouping). I will start explaining the str...
  • BA_Pete's avatar
    BA_Pete
    4 years ago

    Ok. So you need to create a Members dimension table.

    This will be a table with a UNIQUE column of membership ID's, then any number of other columns describing that member e.g. name, address, age, customer group, etc.

    You may already have something like this set up, but let me know if not and we can look at easy ways to dynamically create one from your existing data (will probably be Monday now though I'm afraid).

     

    You then relate dimMembers[MemberID] to both factMemSubs[MemberID] and factInvoices[MemberID]. You then use values from dimMembers in your visuals and this will correctly filter both of your fact tables to select only the member(s) you want to see.

     

    You can also relate your calendar table to factInvoices[issueDate / dueDate / paidDate] and make these relationships inactive, so you can choose via your measures which date to use depending on what you are trying to calculate.

     

    The model structure that you are aiming for is a STAR SCHEMA.

     

    Pete