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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors