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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
dading
Helper II
Helper II

COmbine 2 and solve it

Hello..

Good afternoon

I'm new to power bi.

I hope someone can help me with this.

I have two tables. the first is the computer log table

TimeStartTimeEndEqmt
18/03/2020 7:30:0018/03/2020 15:00:00S1

and second is the login of employees to the team

TimeStamp_LoginEmployeeEqmt
18/03/2020 7:30:00AS1
18/03/2020 9:30:00AS1
18/03/2020 9:40:00BS1
18/03/2020 13:00:00AS1
18/03/2020 14:00:00CS1

I want to combine those tables into a table as below screenshot shown

TimeStartTimeEndEqmtEmployee
18/03/2020 7:30:0018/03/2020 9:40:00S1A
18/03/2020 9:40:0018/03/2020 13:00:00S1B
18/03/2020 13:00:0018/03/2020 14:00:00S1A
18/03/2020 14:00:0018/03/2020 15:00:00S1C

It would be great if someone can suggest how I can accomplish this.

Thank you

6 REPLIES 6
amitchandak
Super User
Super User

@dading , try a new table like

 

summarize(calculatetable(table2,table2[TimeStamp_Login]>=min(Table1[start_time]) && table2[TimeStamp_Login]>=max(Table1[end_time])
&& table2[Eqmt]>=min(Table1[Eqmt])),table2[Employee],table2[Eqmt],Table1[start_time],Table1[end_time])

@amitchandak

I try to copy your formula

are there a mistake in my writing?

 

snapshot1.jpg

 

 

@dading , I forget to put filter

try

summarize(calculatetable(table2,filter(table2,table2[TimeStamp_Login]>=min(Table1[start_time]) && table2[TimeStamp_Login]>=max(Table1[end_time])
&& table2[Eqmt]>=min(Table1[Eqmt]))),table2[Employee],table2[Eqmt],Table1[start_time],Table1[end_time])

Hi @amitchandak 

the result is empty

snapshot2.jpg

@dading , I got it like this. But I am not able get the end time logic, can you explain that

Table = SUMMARIZE(CALCULATETABLE(Table2,filter(table1,Table1[TimeStart]<=max(Table2[TimeStamp_Login]) && Table1[TimeEnd]>=max(Table2[TimeStamp_Login]))),Table2[Employee],Table1[TimeEnd],Table2[TimeStamp_Login],Table1[TimeStart],Table1[Eqmt])

 

Tahreem24
Super User
Super User

@dading ,

 

You have to create relationship between these two table on "Eqmt" of both the tables.

Then put all required columns in table visuals.

1.PNG2.PNG

 

 

Don't forget to give thumbs up 👍 and accept this as a solution if it helped you.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.