Forum Discussion
Relationships
- Anonymous10 years ago
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.
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.
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.
- Jeroenvb110 years agoFrequent Visitor
Thank you Anonymous. 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.
Anonymous thanks for mentioning this formula. I'll try it sometime when i have a comparable problem.
- Anonymous10 years agoNot applicable
Jeroenvb1I frequently work with only inactive relationships. Especially when I have a table that has multiple date columns (think Created On, Modified On, etc). I create a whole bunch of inactive relationships with my date table, then every measure has a USERELATIONSHIP argument to specify how it should behave. That way I can create as many relationships as I want and they never conflict; I just turn them on when I need them and they are ignored every other time. And since it's always stated explicitly there's never any ambiguity if I have to make changes later. I can just look at the measure instead of checking a measure and a relationship to see what it's really calculating.
- mcspringer8 years agoNew Member
@KHorseman, I'm still confused as to why the relationships Jeroenvb1 is talknig about works in PowerPivot but not Power BI. Furthermore, Power BI swapped my FROM-TO relationships when I wanted the relationships the other way. I have three tables. Let's say sales measures in one by product which is linked to a master product file that details more info on the products. Then I have a location table by state that also points to the measures table that has those same states. Why can't I show total sales of one product in a specific state? This works perfectly in PowerPivot. I must be missing something.