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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

How can I combine times from different tables?

Hello. I have 2 different tables showing time a ticket or task was worked, and I need to be able to show the total amount of time worked between a ticket and its associated tasks. A ticket may have more than one task associated with it. 

 

Example data:

TICKETDATA  
Ticket NumberTime worked in Seconds 
TIC001254 
TIC002327 
TIC003500 
   
TASKDATA  
Ticket NumberTask NumberTime Worked in Seconds
TIC001TASK00001180
TIC001TASK00002125
TIC002TASK00003320
TIC003TASK0000484
TIC003TASK00005150
TIC003TASK0000695

 

So TIC001 has 2 tasks associate with it, besides the time worked in the ticket itself. So the total time between the 254 seconds from the ticket, and the time worked between the two tasks should be 559. Is there a way I can get PowerBI to total this between the two tables?

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

Hi  @Anonymous ,

 

If you dont wanna create a relationship,create a measure as below:

Total = 
var _sum=CALCULATE(SUM('TASKDATA'[Time Worked in Seconds]),FILTER(TASKDATA,'TASKDATA'[Ticket Number]=MAX('TICKETDATA'[Ticket Number])))
Return
IF(ISINSCOPE(TICKETDATA[Ticket Number]),_sum+SUM('TICKETDATA'[Time worked in Seconds]),SUMX(ALL(TICKETDATA),'TICKETDATA'[Time worked in Seconds])+SUMX(ALL(TASKDATA),'TASKDATA'[Time Worked in Seconds]))

And you will see:

vkellymsft_0-1627893459729.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hi  @Anonymous ,

 

If you dont wanna create a relationship,create a measure as below:

Total = 
var _sum=CALCULATE(SUM('TASKDATA'[Time Worked in Seconds]),FILTER(TASKDATA,'TASKDATA'[Ticket Number]=MAX('TICKETDATA'[Ticket Number])))
Return
IF(ISINSCOPE(TICKETDATA[Ticket Number]),_sum+SUM('TICKETDATA'[Time worked in Seconds]),SUMX(ALL(TICKETDATA),'TICKETDATA'[Time worked in Seconds])+SUMX(ALL(TASKDATA),'TASKDATA'[Time Worked in Seconds]))

And you will see:

vkellymsft_0-1627893459729.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Ashish_Mathur
Super User
Super User

Hi,

Create another 1 column table with a unique list of ticket numbers.  Create a relationship between the ticket number column of both tables to this thid table.  To your visual, drag Ticket number from this third table.  Write this measure

Time worked = sum(ticketdata[time worked in seconds])+sum(taskdata[time worked in seconds])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Anonymous 

 

There should be a one to many relationship between those two tables:

JesusYaya_1-1627678762520.png

And then just a simple measure could help you get the total time for a ticket:

Total Time = SUM(TASKDATA[Time Worked in Seconds]) + SUM(TICKETDATA[Time worked in Seconds])

The result in a table would look like this:

JesusYaya_0-1627678731099.png

Jesus.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.