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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ConstMoss
Helper I
Helper I

ambiguous relationships in Power BI model

hello everyone - 

 

Untitled.png

 

we have the following transaction tables - orders (from customers), invoices, and ledgers.  and three dimensions (customers, products, region)

The dashed lines are many to many joins between fact tables using  intermediate tables. We need to be able to look at an order number, and see order amount, invoice amount and payment amount (payment comes from ledger). The problem is that we are not able to link invoices and payments (using an intermediate table) because this would introduce ambiguity between ledger and dimensions (customers, products, region).

 

Any idea how to go about this?

 

4 REPLIES 4
v-jiascu-msft
Employee
Employee

Hi @ConstMoss,

 

The relationships all depend on your data model. It seems the ledger has the details of invoices. If you can find out a compound primary key, there will no influence on other dimensions. For example:

Ledger:

RowID    InvoiceNumber  InvoiceRowID  Product  Payment

1            In001                  1                      A            100

2            In001                  2                      B            200

 

Invoice:

InvoiceNumber InvoiceRowID   Product   Amount

In001                 1                       A             10

In001                 2                       B              20

 

If the InvoiceNumber and InvoiceRowID can determine a unique row of each table, we can join two column to get a compound primary key.

1. Add a new column to Ledger:

RelationshipCol = CONCATENATE([InvoiceNumber],[InvoiceRowID])

2. Add a new column to Invoice:

RelationshipCol = CONCATENATE([InvoiceNumber],[InvoiceRowID])

3. Create relationship between these two columns. Only the relationship between Invoices and Middletable is bi-direction.

If this can't be a solution, please provide a sample in TEXT mode. The .pbix file would be great.

 

Best Regards!

Dale

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

hi Dale (@v-jiascu-msft) - thanks for your response.

 

direct relationship between invoice and ledger is not possible so i am using a bridge table to connect them. i can work on putting togther a pbix file for you. can you think of any other solution?

Hi @ConstMoss,

 

Please share your .pbix file. You can upload it into the cloud driver then share the link here or through private messages.

 

Best Regards!

Dale

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

Hi @v-jiascu-msft

 

i just uploaded the model and sent you the link using private message. please let me know if you need anyhting else. thanks for your help.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.