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
muff91
Regular Visitor

Relationship between calendar table and other tables

Dear all,

 

I am using three different tables:

 

1. Calendar

2. Orders (auf_tb)

3. Delivery notes (lip_tb)

 

muff91_0-1707983113326.png

 

Orders and delivery notes (1:n) have a relation based on the order ID.

Both tables have a relation with the calendar table using the creation date.

 

As you can see in the screenshot the connection between orders and calendars is not active.

When trying to activate the connection the system shows an error message with the information that there is a connection between orders and delivery notes already.

 

How can I solve this issue?

 

Thanks a lot!

Marvin

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

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

 



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
BA_Pete
Super User
Super User

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

 



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




tharunkumarRTK
Solution Sage
Solution Sage

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

 

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.

Top Solution Authors
Top Kudoed Authors