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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Leesanity
Frequent Visitor

How to use a relation table to connect 2 fact tables

Hi community,

 

Can someone help me with the question below? 


Now I have 3 tables:

1) Fact table 1: The article expected to be in the store A on 04.06.24 and 05.06.24.

 

DateStoreArticle
04.06.24Store AArticle A
04.06.24Store AArticle B
05.06.24Store AArticle A
05.06.24Store AArticle B

 

2) Fact table 2: The artcle availability in different DC on 04.06.24 and 05.06.24.

 

DateDCArticleQty
04.06.24DC AArticle A1
04.06.24DC BArticle A0
04.06.24DC CArticle A0
05.06.24DC AArticle A1
05.06.24DC BArticle A1
05.06.24DC CArticle A0
04.06.24DC AArticle B0
04.06.24DC BArticle B0
04.06.24DC CArticle B0
05.06.24DC AArticle B0
05.06.24DC BArticle B0
05.06.24DC CArticle B0

 

3) Dimension table: Store A can be fulfiled by which DCs

 

StoreDC
Store ADC A
Store ADC B
Store ADC C


Goal is to have a calculated column named DC availability in fact table 1 based on the info in fact table 2 and dimension table:

The DC availability is the sum of the Qty of Article A among the DCs which can fulfil Store A based on the dimension table (DC A, DC B & DC C in this case).

 

DateStoreArticleDC availablity
04.06.24Store AArticle A1
04.06.24Store AArticle B0
05.06.24Store AArticle A2
05.06.24Store AArticle B0

 

Thanks in advanced for your help!

Cheers

2 REPLIES 2
Greg_Deckler
Super User
Super User

@Leesanity Can you post that data as text so it can be copied and pasted? Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi Greg,

 

Thanks for the feedback! I have edit my original post. Please have a look and let me knoe if the problem statement is clear for you.

 

Cheers,

Tian

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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