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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
carlovsky
Helper II
Helper II

How to create a virtual relationship between two fact tables

I have two Fact tables:

Both of them have a relationship with Product and Vendor Dimension

 

FACT_PURCHASE_ORDER_PRODUCT: Aggregated at Purchase Order and Product Level

SK_PURCHASE_ORDERSK_VENDORSK_PRODUCTQUANTITY_ORDERED
145819311231500
145819311241000
14581931125500
145919331000500
145919339511000
146019312141500

 

FACT_SALES_PRODUCT: Aggregated at Vendor and Product Level

SK_VENDORSK_PRODUCTL30D_ITEMS_SOLD
1931129500
19311841200
19318411200
1933951

900

 

General considerations:

- One PO can contain multiple products, but it's always from the same Vendor.

- The combination from SK_VENDOR and SK_PRODUCT shown in FACT_SALES_PRODUCT is unique accross all the table

 

My goal:

 

Create a matrix visualization table at SK_PURCHASE_ORDER Level(Only with SK_PURCHASE_ORDER on the matrix), where I can display the quantities ordered in each PO + the L30D Items Sold from the Supplier related to that PO(When I mean all, I mean Total Supplier Sales in the L30D for ALL the products that he has sold, regardless they have a PO or not )

 

Example:

SK_PURCHASE_ORDERQUANTITY_ORDEREDL30D_ITEMS_SOLD
145830002900
14591500900
14605002900

 

Any idea on how I can achieve this?

 

Thanks

Diego

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @carlovsky 
Please refer to attached sample file

1.png

L30D Sold Quantity = 
CALCULATE ( 
    SUM ( FACT_SALES_PRODUCT[L30D_ITEMS_SOLD] ),
    FACT_SALES_PRODUCT[SK_VENDOR] IN VALUES ( FACT_PURCHASE_ORDER_PRODUCT[SK_VENDOR] )
)

View solution in original post

3 REPLIES 3
carlovsky
Helper II
Helper II

Thanks a lot

tamerj1
Super User
Super User

Hi @carlovsky 
Please refer to attached sample file

1.png

L30D Sold Quantity = 
CALCULATE ( 
    SUM ( FACT_SALES_PRODUCT[L30D_ITEMS_SOLD] ),
    FACT_SALES_PRODUCT[SK_VENDOR] IN VALUES ( FACT_PURCHASE_ORDER_PRODUCT[SK_VENDOR] )
)

Hi again,

 

Inside Vendor Dimension I have a attribute called Manager.

The Manager field can be linked to one or more SK_VENDOR

 

 Following the same logic Based on your type of calculation, do you know how I could call for each table a related column from its dimension?

 

Do you know how I could get for this instance the L30D Items Based on Manager ?

 

Thanks

Diego

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors