Forum Discussion
Anonymous
3 years agoNot applicable
Creating a filtered table based on another one
Here's the link to the file Hey there I'd like to create a table that filters every row of my Fact table as long as the rows' dates are prior or equal to the due date (stored on its own table...
- 3 years ago
In your data model, I didn't see any necessity of d_users since f_due_user[User_id] is a distinct column; you can built a relationship between f_due_user (1:*) Fact by [User_id].
Anyway, the solution based on your current model,
Summarized Table = GENERATE( f_due_user, VAR __due = f_due_user[Due_payment] RETURN SELECTCOLUMNS( CALCULATETABLE( SUMMARIZE( 'Fact', 'Fact'[User_id], 'Fact'[Subscription_date] ), CALCULATETABLE( d_users ), 'Fact'[Subscription_date] <= __due ), "@subscription", 'Fact'[Subscription_date] ) )
ThxAlot
3 years agoSuper User
Glad that my proposal helps!
In the current data model, filters on f_due_user can't be propagated to Fact table in a natural manner; thus Expanded Table ( CALCULATETABLE(d_users) ) can be leveraged here for filter propagation.
Anonymous
3 years agoNot applicable
You're totally right. Thanks for your explanation.