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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Olga_S
Frequent Visitor

How to connect fact tables that have different granularity?

Hi

I have several fact tables that have different granularities (date-year, customer-customer group, product-product group). 

How to connect these tables in data model that values defined on higher level (for ex. product group) would be repeated on lower levels (product)? 

 

I read that i can merge tables in Power Query, but due to the table size it takes ages to merge talbes. In addition merge does not always work (known bug with our server). Connection in data model does not wokt due to M:M relationship).

data model.jpg

data and expected result.jpg

Thanks! 

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @Olga_S ,

 

We can create six columns to meet your requirement.

 

1. Create the year column in Sales table.

 

Year = YEAR(Sales[Date])

 

howto1.jpg

 

2. Create two columns to get the customer group and product group in Sales.

 

Product Group = 
CALCULATE(MAX('Product'[Product group]),FILTER('Product','Product'[Product]=Sales[Product]))

 

Customer Group = 
CALCULATE(MAX(Customers[Customer Group]),FILTER(Customers,Customers[Customer]=Sales[Customer]))

 

howto2.jpg

 

3. At last we can create three columns to get the result.

 

Product% = 
CALCULATE(SUM('Product discount'[%]),FILTER('Product discount','Product discount'[Year]=Sales[Year]&&'Product discount'[Product group]=Sales[Product Group]))

 

Customer% = 
CALCULATE(SUM('Customer discount'[%]),FILTER('Customer discount','Customer discount'[Year]=Sales[Year]&&'Customer discount'[Customer Group]=Sales[Customer Group]))

 

Total = [Product%]+[Customer%]

 

howto3.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

View solution in original post

2 REPLIES 2
v-zhenbw-msft
Community Support
Community Support

Hi @Olga_S ,

 

We can create six columns to meet your requirement.

 

1. Create the year column in Sales table.

 

Year = YEAR(Sales[Date])

 

howto1.jpg

 

2. Create two columns to get the customer group and product group in Sales.

 

Product Group = 
CALCULATE(MAX('Product'[Product group]),FILTER('Product','Product'[Product]=Sales[Product]))

 

Customer Group = 
CALCULATE(MAX(Customers[Customer Group]),FILTER(Customers,Customers[Customer]=Sales[Customer]))

 

howto2.jpg

 

3. At last we can create three columns to get the result.

 

Product% = 
CALCULATE(SUM('Product discount'[%]),FILTER('Product discount','Product discount'[Year]=Sales[Year]&&'Product discount'[Product group]=Sales[Product Group]))

 

Customer% = 
CALCULATE(SUM('Customer discount'[%]),FILTER('Customer discount','Customer discount'[Year]=Sales[Year]&&'Customer discount'[Customer Group]=Sales[Customer Group]))

 

Total = [Product%]+[Customer%]

 

howto3.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

amitchandak
Super User
Super User

@Olga_S . year you can convert to date like .

date = date([year],1,1)

 

for the customer discount and product discount, you do not join with customer dim or product dim. Create a filter in measure

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors