Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Varishtha
Helper I
Helper I

Filter a fact table based on another (indirectly connected) fact table

I have multiple fact tables (red arrows) connected to one dimension table ('user') in my data model. 'user' table has 'ID' as primary key which serve as foreign key in all the connected fact tables (using column name - 'UserID'). 'jsacm_capmpaigns' contain each unique campaigns details and 'js_main_clicklog_userwise' contains dailywise and userwise daily clicks summary and 'user' table has details of each users. A user can have multiple campaigns and a campaign can have multiple jobs(uniquely listed in 'jobsdatafull' table). Below is the picture for reference.

Varishtha_0-1705234398981.png

 

Now since i have formed a two-way relationship between 'jsacm_campaigns' and 'users' table, filter can flow from 'jsacm_campaigns' to 'users'. But I want to filter the other fact table 'js_main_clicklog_userwise' as well using  filters from 'jsacm_campaigns'.

 

For example, for every campaign in 'jsacm_campaigns' table, i want to filter 'js_main_clicklog_userwise' table, based on below filters:

  1. 'jsacm_campaigns'[user_id] = 'js_main_clicklog_userwise'[user_id]
  2. 'js_main_clicklog_userwise'[date]<='jsacm_campaigns'[end_date]
  3. 'js_main_clicklog_userwise'[date]>='jsacm_campaigns'[start_date]

 

Some reference to visuals i want to create. Clicking on campaign name should filter the two trend graphs below.

Varishtha_1-1705237347620.png

 

 

Once i can filter 'js_main_clicklog_userwise' table based on above conditions, i intend to visualise 'js_main_clicklog_userwise' which can be filtered based on above conditions from 'jsacm_campaigns'. Also if possible, i want to drill down campaigns from main page of report filter to another detailed page.

It would be great if someone could help me with this.

3 REPLIES 3
lbendlin
Super User
Super User

Instead of these data model modifications the safer way is to use TREATAS to transfer a filter context from one table to another (unrelated) table.

hi @lbendlin 

Thanks for the response.

Could you please explain more about this approach, since i need to use multiple filters on the unrealted table.

Your help is greatly appreciated.

 

There are good tutorials on the usage of TREATAS - choose one that fits your learning style. You can also look at the queries in the performance analyzer, they make extensive use if it.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.