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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

How to calculate a DAX measure over multiple (fact) tables?

Hello,
I have a question about working with 2 different fact tables. 1 = DirectQuery and 2 = imported.

How can I calculate a DAX measure over multiple fact tables in one single measure combined? And how to connect a DirectQuery fact table with an imported fact table?


For example:

I have factable 1 (DirectQuery) with the following columns:

  • Date
  • EventType (visits, clicks, impressions, etc)
  • Multiple ID's to combine the fact table with multiple dimension tables
  • SourceID (SourceID = 1 , 2 , 3)

I have factable 2 (import) with (almost) the same data from a different source:

  • Date
  • EventType (visits, clicks, impressions, etc)
  • SourceID (SourceID = 4 , 5 , 6)

I used to combine these two fact tables with the Query Editor, but now we use DirectQuery for fact table 1 and imported fact table 2 in power BI desktop. So we can't combine them in the Editor, because we then need to import all the tables. And that's not what we want because of the amount of data (datamodel refresh problems).

 

In one measure I'd like to calculate the sum of visits, clicks, etc, in fact table 1 and fact table 2,
so I can visualise for both fact tables combined:

- The total visits per date

- The total visits per source 
- The totoal visits per dimension table 


Anyone who can help me with this case? Thank you very much in advance.
Rens

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Anonymous,

 

You can join each fact table to the dimension tables, and create measures using the following approach (Visits example):

 

Visits Table 1 = SUM ( Table1[Visits] )

 

Visits Table 2 = SUM ( Table2[Visits] )

 

Total Visits = [Visits Table 1] + [Visits Table 2]

 

As far as connecting the two fact tables--this is done by connecting them to shared dimension tables.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thx @DataInsights 

That sounds like a simple solution for my problem! 

I've tried it this way before, but then I didn't have the relationships in my data model set correctly.
After changing some filter directions in the model it worked for me.

 

Thx!
Rens

DataInsights
Super User
Super User

@Anonymous,

 

You can join each fact table to the dimension tables, and create measures using the following approach (Visits example):

 

Visits Table 1 = SUM ( Table1[Visits] )

 

Visits Table 2 = SUM ( Table2[Visits] )

 

Total Visits = [Visits Table 1] + [Visits Table 2]

 

As far as connecting the two fact tables--this is done by connecting them to shared dimension tables.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.