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
dading
Helper II
Helper II

COmbine 2 table and summarize it

Hi..

Good afternoon,

 

I'm new in power bi.

i hope someone can help me out on this one.

 

i have 2 table. the first one is equipment record table

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

 

and second is employee login at equipment

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 table into one table as shown below

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 anyone can suggest how I can achive this.

 

thank you

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @dading 

 

Please see the attached file with a solution in Power Query

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

5 REPLIES 5
Mariusz
Community Champion
Community Champion

Hi @dading 

 

Please see the attached file with a solution in Power Query

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Hi @Mariusz 

 

Wow..this is amazing!

this is what i want

 

by the way

i see a step of "grouped rows" in your file, how to do that actually?

is there a button in power query editor to do that? or we must write that formula?

Mariusz
Community Champion
Community Champion

Hi @dading 

 

Yes, please see the below 

image.png

The only thing that I have added is Group Kind as per below, this is to make sure it groups only values that are the same and next to each other and not alltogether
image.png

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn



Ow Ok
I understand now
Thank you very much👍👍👍
amitchandak
Super User
Super User

Try 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])

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.