cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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.

 Date Store Article 04.06.24 Store A Article A 04.06.24 Store A Article B 05.06.24 Store A Article A 05.06.24 Store A Article B

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

 Date DC Article Qty 04.06.24 DC A Article A 1 04.06.24 DC B Article A 0 04.06.24 DC C Article A 0 05.06.24 DC A Article A 1 05.06.24 DC B Article A 1 05.06.24 DC C Article A 0 04.06.24 DC A Article B 0 04.06.24 DC B Article B 0 04.06.24 DC C Article B 0 05.06.24 DC A Article B 0 05.06.24 DC B Article B 0 05.06.24 DC C Article B 0

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

 Store DC Store A DC A Store A DC B Store A DC 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).

 Date Store Article DC availablity 04.06.24 Store A Article A 1 04.06.24 Store A Article B 0 05.06.24 Store A Article A 2 05.06.24 Store A Article B 0

Cheers

2 REPLIES 2
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

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.

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Frequent Visitor

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.