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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
cverster
Regular Visitor

Relationship Query

Hi there

 

I have the following two tables, with an intermediary table that I created to get a relationship between them:

 

Table 1:

NameEventDateTimeInSeconds
Doe, John2017/04/17 00:00:0043200

 

Table 2:

ResourceIDProjectDateHours
JDoe2021/05/12 00:00:008

 

Table 3 (intermediary):

NameResourceID
Doe, JohnJDoe

 

I've got a  One-To-Many relationship between Table 2 and 3 (Matched on resource ID, one entry in Table 3, many in Table 2), and I've got a Many-To-Many relationship between Table 1 and Table 3 on Name.

 

I want to compare the TimeInSeconds column for a specific date to the Hours column for the same date (EventDate and ProjectDate respectively). When I just do the Name + ResourceID relationships and I try put everything in a table visual, EventDate and ProjectDate don't match up. When I create a relationship between EventDate and ProjectDate, EventDate stops reflecting as a date (though it's data type is datetime), and they still don't match.

 

How can I get this data to a place where I can use both TimeInSeconds (Table 1) and Hours (Table 2) in the same Dax formula?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @cverster ,

I created a sample pbix file (see attachment) for you, please check whether that is what you want.

1. Create a date dimension table

2. Create relationships among date table(Date field), Table 1(Event Date field) and Table 2(Project Date field)

yingyinr_0-1626675400696.png

3. Create a measure to get the time of Events in hours, it will be convenient for comparison with project hours

EventHours = DIVIDE ( SUM ( 'Table 1'[TimeInSeconds] ), 3600, 0 )

yingyinr_1-1626675551730.png

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @cverster ,

I created a sample pbix file (see attachment) for you, please check whether that is what you want.

1. Create a date dimension table

2. Create relationships among date table(Date field), Table 1(Event Date field) and Table 2(Project Date field)

yingyinr_0-1626675400696.png

3. Create a measure to get the time of Events in hours, it will be convenient for comparison with project hours

EventHours = DIVIDE ( SUM ( 'Table 1'[TimeInSeconds] ), 3600, 0 )

yingyinr_1-1626675551730.png

Best Regards

Thanks for this, the intermediate date table is what I needed!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.