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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
lefinalzugzwang
Frequent Visitor

Implementing a date table without interfering with existing relationships

Hi all, 

I am trying to compare data from my Sales table, to data in my Forecasts table. I have two different date fields involved here. Forecast.Date which is the date that a particular sale from Forecasts is predicted to take place, and Sales.Date which is the actual date when a particular sale took place. Below is a screengrab of my schema.

 

Model.png

 

As you would expect, everything revolves around products! So here's the question... Obviously there are many tables here which have a date field. As of yet I haven't been able to properly analyse disparate tables by date in a single visual. I know that I probably need a date table. But I don't fully understand how to create relationships between these dates/date table without disrupting the schema and hence other relationships.

For example, if I wanted to create a matrix with Product.Name as the rows, and then Months as columns, and as values have Forecast.Value and Sale.Value as my values. At the moment the date filtering only works for one set of these values. But when I try to implement the Date Table between forecast.date and sale.date I lose one of the relationships between these and the product table. 

I've tried to be as clear as possible, apologies if this doesn't come through!

L

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lefinalzugzwang,

 

>>But I don't fully understand how to create relationships between these dates/date table without disrupting the schema and hence other relationships.

 

For the date table, I'd like to suggest you create with all tables date fields, for example:

 

Date Table = 
var temp=DISTINCT(UNION(VALUES(Table1[Date]),VALUES(Table2[Date]),VALUES(Table3[Date]),...))
Return
CALENDAR(MINX(temp,[Date]),MAXX(temp,[Date]))

 

 

Then you can create one to many relationship from calendar table to each other table which contains the date field, use calendar table as source of the filter.

 

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
MattAllington
Community Champion
Community Champion

Turn off the bidirectional filtering in your current relationships. Then you can add your date table without any problems. Send me a pm with your email address and I will send you a pre release of my blog article on this topic (not due for release until 14 Feb



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Thanks a lot for this, it does sort of make sense that the relationships should be set up like this, and it's what I did. I am going to pm you once I figure out how to do so!

Anonymous
Not applicable

Hi @lefinalzugzwang,

 

>>But I don't fully understand how to create relationships between these dates/date table without disrupting the schema and hence other relationships.

 

For the date table, I'd like to suggest you create with all tables date fields, for example:

 

Date Table = 
var temp=DISTINCT(UNION(VALUES(Table1[Date]),VALUES(Table2[Date]),VALUES(Table3[Date]),...))
Return
CALENDAR(MINX(temp,[Date]),MAXX(temp,[Date]))

 

 

Then you can create one to many relationship from calendar table to each other table which contains the date field, use calendar table as source of the filter.

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.