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
erick2599
New Member

separete 2 values in the same columns first would be break 1 and second would be break 2

Emp_fullnameDate_TimeBreak
Name14/9/2023 11:3000:05:30
Name14/9/2023 12:0000:06:48
Name14/9/2023 17:0000:10:05
Name24/9/2023 16:3000:19:58
Name24/9/2023 17:0000:09:21
Name34/9/2023 11:0000:14:59
Name34/9/2023 16:0000:15:00
Name44/9/2023 12:0000:15:00
Name44/9/2023 16:3000:13:53
Name44/9/2023 17:0000:01:03

 

I want to separete the first break to the second break, so I can compare the time the person use Break 1 and Break 2. The issue is that both values are in the same column and some of them even have 3 entries.

1 REPLY 1
amitchandak
Super User
Super User

@erick2599 , You need to have rank column

I think for that you also need a date column

 

New columns in the table 

 

Date = datevalue([Date_time])

 

Break Rank = Rankx(filter(Table, [Emp_name] = earlier([emp_name]) && [Date] = earlier([Date]) ) , [Date_time])

 

Now create a table

Compare = generateseries(Min(Table[Break Rank]), Min(Table[Break Rank]) )

 

Join the value column with Break Rank column

 

Now create these measures

 

1st Break time= calculate(Sumx(Table, Hour([Break])*3600 +Minute([Break])*60 + Second([Break]) ) , filter(all(Compare ), Compare[Value]=1) )

 

2nd Break time= calculate(Sumx(Table, Hour([Break])*3600 +Minute([Break])*60 + Second([Break]) ) , filter(all(Compare ), Compare[Value]=2) )

 

you can take a diff

 

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.