How to connect together multiple fact tables

lourson

New Member
Joined
Feb 22, 2013
Messages
8
Hi,
I have multiple fact tables, and dimension tables. My question is : what is the best way to connect the fact tables together.
At first I just connected each fact table to my dimensions. For basic calculation, that is working fine. But then I need to create conditions covering multiple fact tables and I'm starting to create a schema like hell, which doesn't seem a long term reliable idea.
Click here to see a version of my schema with the minimum details (I will be adding more facts tables):

Most of my information is related to user accounts, and my DimAccount get me all my users ID.
here the kind of metrics I'd like to have, which requires me to look at data in multiple fact tables at once:

  • Number of users who have 1 Thread but no Answers and no Actions.
  • Most active users (number of threads or answers) on a given period
How do you suggest I do that ? I've used the DimAccounts table to create calculated columns which get the values from each fact tables, is this a correct way to do that ? It feels bad...
Thanks a lot !
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Creating calculated columns would generate static data, whereas you might want to analyze a specific period of data in a dynamic way.
For example, the following calculation would solve the "Number of users who have 1 Thread but no Answers and no Actions" even if it wouldn't work with your schema because I don't see a relationship between DimAccounts and ActionData.

Code:
UsersOneThread :=
COUNTROWS (
    FILTER (
        DimAccounts,
        CALCULATE ( COUNTROWS ( Threads ) ) = 1
        && CALCULATE ( COUNTROWS ( Answers ) ) = 0
        && CALCULATE ( COUNTROWS ( ActionData ) ) = 0
    )
)

The following one (Most active users) can be resolved in different ways, it depends if you want a PivotTable or a DAX query. What is your goal?
 
Upvote 0
Thank you very much for your insight. I haven't thought of such an elegant way to handle this problem! It seems to work fine (once I added the missing relationship indeed). I'm cleaning right now my old fashion way :eek:

Regarding the other data, I'm constructing a dashboard with slicers and many graphs and I'd like to include a table with the TOP users list. I'm not sure which way would be best to do so?
 
Upvote 0
Hi

Related question with the same dashboard, in order to extend the "Number of users who have 1 Thread but no Answers and no Actions" KPI : If I wanted to filter on users who have subscribed at least XX weeks before the current week, how could I do that? (XX could be 1 for now).

I imagine I should connect my DimDate to DimAccount, but is this correct to relate 2 Dimension tables? And even if, how can I do such a date filter?
Thanks again
 
Upvote 0
Probably something like that:
Code:
UsersOneThreadSomeWeeksAgo :=
COUNTROWS (
    FILTER (
        DimAccounts,
        CALCULATE ( 
            COUNTROWS ( Threads ),
            FILTER ( 
                ALL ( 'Date'[WeekNumber] ),
                'Date'[WeekNumber] <= @CurrentWeekNumber - 2
            )
        ) = 1
        && CALCULATE ( COUNTROWS ( Answers ) ) = 0
        && CALCULATE ( COUNTROWS ( ActionData ) ) = 0
    )
)
 
Upvote 0
Thanks again Marco ! I'm not familiar with references such as @CurrentWeekNumber and this one seems not to be recognized. Any idea?
 
Upvote 0
The @CurrentWeekNumber is just a placeholder - it could be a parameter if this was a query, but if you want to create a measure in such a way, how do you identify which is the "current week" ? if it is the one selected in the PivotTable, you might replace it with MAX( 'Date'[WeekNumber] )
 
Upvote 0

Forum statistics

Threads
1,215,487
Messages
6,125,081
Members
449,205
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top