Reply
Frequent Visitor
Posts: 5
Registered: ‎06-20-2016
Accepted Solution

Relationships

Hi all,

 

I am trying to load sales and budget data into PowerBI from Dynamics NAV. For this, i have created three queries, customers, customer ledger entries, article budget entries and one Alldates excel list. Eventually i want to graphically represent for each customers the sales and budget per month.

 

So far, so good ive loaded them into PowerBI. The next thing i try to do is create relationships between these four datasets. It works perfectly fine in powerpivot, as you can see below, but when i try the exact same thing in powerBI, it does not work. I cannot make a 'closing' set of relationships. Can somebody help me with this?

 

Thank you in advance,

Jeroen

 

Relationships.JPG

 


Accepted Solutions
Regular Visitor
Posts: 40
Registered: ‎02-02-2016

Re: Relationships

[ Edited ]

Try playing around a bit with the Cross Filter Direction on each relationship, setting them to Single, as opposed to Both, in this situation might work.  That might allow you to define the relationships without making any of them inactive.  Of course once you get them defined be sure to check the interactivity on the visuals you have to ensure they are reacting as necessary for your usage scenario.

View solution in original post


All Replies
Super Contributor
Posts: 1,662
Registered: ‎12-15-2015

Re: Relationships

@Jeroenvb1 for each relation that you create in power bi make sure you set cross filter direction to Single and this should let you create all relations. If not please post what error you get when creating the fourth one.

 

Frequent Visitor
Posts: 5
Registered: ‎06-20-2016

Re: Relationships

Thank you for your response Ankipatira.

I can create the relationships seperately up to three relationships, but not all four together. It seems like PowerBI does not want to create a closing circle which is strange because powerpivot does not give this error. See a screenshot of the error below:

 

Error creating relationships.JPG

Member
Posts: 70
Registered: ‎04-21-2016

Re: Relationships

Tjena @Jeroenvb1

Problem is occuring because filter is getting passed to other tables.

Can you do following ?

Create another Datum table, a copy may be(call it Klanten Date), and create realtionship of it with Klanten. Kind of breaking the loop.

Hope it helps you !

Also provide some sample data here so we can mimic your problem.

BR,

/Achin

 

Frequent Visitor
Posts: 5
Registered: ‎06-20-2016

Re: Relationships

Hi Tjena,

 

What exactly do you mean with "filter is getting passed to other tables"? I tried removing all filters on the queries but it did not help any.

 

I also duplicated the datum table and created a relationship between cust. ledger entries and klantendate and between article budget entries and datum. This indeed breaks the loop but i the problem remains the same. If you want to see see the sales and budget per month, you still need to have some date link between these two. Do you have any other ideas.

 

I have some sample data but apparently i cannot upload this into this post. Maybe i can send it to you?

 

Kind regards

Frequent Visitor
Posts: 5
Registered: ‎06-20-2016

Re: Relationships

Here i have some screenshots of the queries:

art budget entriesart budget entriescust ledger entriescust ledger entriesCustomersCustomers

Super Contributor
Posts: 1,152
Registered: ‎12-29-2015

Re: Relationships

[ Edited ]

@Jeroenvb1 It's not filters on queries @achinm45 is referring to. If you have relationships between tables, any filter context you create in a report (by placing a measure next to a column for instance) or a measure gets passed along those relationships whenever anything is calculated. 

 

Let's say you have three tables. TableA, TableB, TableC, each with 3 columns. You have a relationship between TableA[Column1] and TableB[Column1], and another between TableB[Column2] and TableC[Column2]. You cannot now create an active relationship between TableA[Column3] and TableC[Column3] because TableA and TableC are already related via the shared relationships with TableB. That's what this error message is telling you. You can't have two active relationship pathways between any pair of tables, because Power BI would have no way of knowing which pathway to use when evaluating a filter context, and the two pathways could result in very different filtered results.

 

You can however create an inactive relationship, and then write specific measures to reference it via the USERELATIONSHIP function, but the relationship will be ignored in all other cases that don't reference the relationship in that way.

Regular Visitor
Posts: 40
Registered: ‎02-02-2016

Re: Relationships

[ Edited ]

Try playing around a bit with the Cross Filter Direction on each relationship, setting them to Single, as opposed to Both, in this situation might work.  That might allow you to define the relationships without making any of them inactive.  Of course once you get them defined be sure to check the interactivity on the visuals you have to ensure they are reacting as necessary for your usage scenario.

Member
Posts: 70
Registered: ‎04-21-2016

Re: Relationships

Thank You @KHorseman for such a valuable explanation of scenario. I had calculated that in mind but your way of jotting it here is nice.

Frequent Visitor
Posts: 5
Registered: ‎06-20-2016

Re: Relationships

Thank you @eskyline. I've been trying some with changing the Cross filter direction to single and this worked for me. PowerBI automatically sets it to Both, opposed to powerpivot who sets it to single. That explains why it did work in powerpivot and the same circular relationship not in powerbi.

 

@KHorseman thanks for mentioning this formula. I'll try it sometime when i have a comparable problem.