Forum Discussion
Relationship between calendar table and other tables
- 2 years ago
Hi Marvin,
You're getting this error as you're creating an ambiguous filtering scenario. For example, if Power BI allowed you to also make the CALENDAR > auf_tb relationship active, what would happen when you selected a date in the CALENDAR table? PBI would filter auf_tb to the orders with that [creation date], auf_tb would then filter lif_tb to all the orders that share an [order id], but then CALENDAR is also trying to filter lif_tb to orders with the [creation date] selected - what if these aren't the same orders that share an [order id] with the filtered auf_tb ones? Hence the error.
In terms of fixing it, it really depends on what you want the behaviour of your model to be.
In this scenario, you could possibly remove the relationship between CALENDAR > lif_tb and make CALENDAR > auf_tb active. This would propogate filters like this:
CALENDAR[date] > auf_tb[creation date] :: auf_tb[order id] > lif_tb [order id]
I.e. When you select a date in your CALENDAR table, auf_tb will be filtered to all orders that were created on that date and lif_tb would be filtered to all orders that share an [order id] with the filtered orders in auf_tb.
The first thing you need to do is understand what you want your model to do when you select a table value, then have a look at filter propogation in PBI/AS models, then set up your relationships to have the desired effect.
Pete
Among the two relations ( calendar 1 -> * orders, calendar 1 -> * delivery_notes) you can only have one active relationship. Because you already have one active relation between orders and delivery notes (1 -> *). Otherwise you will have ambiguious path between calendar and delivery_notes. You can continue with inactive relationship and utilize crossfilter() dax function to make the relation between calendar and orders active whenever required.
If the post helps please give a thumbs up
If it solves your issue, please accept it as the solution to help the other members find it more quickly.
Tharun