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
thmonte
Helper IV
Helper IV

Help with relationship modeling multiple tables with dates

Hello all,

 

I'm having an issue right now linking up multiple tables and I can't seem to find a solution

 

I have the following tables

  • Date Table - Used as master date table to link all tables.  Used in slicers.
  • Person Details Table - This table has a record for each employee for each day and a few attributes about themselves
  • Work Details Table - This table has a record for each day an employee worked
  • Absent Details Table - This table has a record for each day an employee worked

 

Right now I have all working properly besides the Absent table.  I just added this and I expected to create a relationship with the Date Table and Person Details Table but the application is stoping me.  Here are the current relationships

  • Date Table to Work Details Table - On Date - Many to One
  • Work Details Table to Person Details Table - On ID - Many to Many

 

The plan was to add the absent table, make a relationship to Date Table (On Date) and Person Details Table (On ID) that way when I filter use the Date Table I'll get the correct data for that day in the Personnel Details table as well as any Work Details/Absent Details associated with that date as well.

 

Here some sample tables.

 

Date Table

Date
3/1/2020
3/2/2020
3/3/2020
3/4/2020
3/5/2020
3/6/2020
3/7/2020
3/8/2020
3/9/2020
3/10/2020
3/11/2020
3/12/2020
3/13/2020

 

Personnel Details Table

dateidnameage
3/1/2020ajohn50
3/1/2020bjames50
3/1/2020cjoe50
3/2/2020ajohn50
3/2/2020bjames51
3/2/2020cjoe50
3/3/2020ajohn50
3/3/2020bjames51
3/3/2020cjoe50
3/4/2020ajohn50
3/4/2020bjames51
3/4/2020cjoe50

 

Work Details Table

dateidjob type
3/1/2020achef
3/1/2020bmechanic
3/1/2020csecurity
3/2/2020achef
3/2/2020bmechanic
3/2/2020csecurity
3/3/2020achef
3/3/2020bsecurity
3/3/2020cgardner

 

Absent Details Table

dateidreason
3/4/2020ascheduled day off
3/4/2020bscheduled day off
3/4/2020cscheduled day off
3/5/2020bvacation
3/5/2020cvacation

 

Any help would be appreciated!

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@thmonte ,

 

So your requirement is to build a absent table and make another relationship bridge between 'Date' and 'Person Details', right? I'm afraid this may cause ambiguous error. You need to disable the relationshio between 'Date' and 'Work Details', 'Work Details' and 'Person Details' firstly.

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yuta-msft
Community Support
Community Support

@thmonte ,

 

So your requirement is to build a absent table and make another relationship bridge between 'Date' and 'Person Details', right? I'm afraid this may cause ambiguous error. You need to disable the relationshio between 'Date' and 'Work Details', 'Work Details' and 'Person Details' firstly.

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

You should have continuous, preferably created using calendar and mark as Date. Common Id table and join to all other tables.

Here are some articles I wrote that should help you. 

https://exceleratorbi.com.au/the-optimal-shape-for-power-pivot-data/

https://exceleratorbi.com.au/multiple-data-tables-power-pivot/

https://exceleratorbi.com.au/create-lookup-table-power-pivot/

 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

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.