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
Anonymous
Not applicable

Create time column based on other column conditions

Dear friends 

 

I need help in order to solve a problem trying to create start counting time column to show the date added 13 hr, in case of the rest time is more than 10 hr indivisually

and event column to show rest time that more than 3 hr but less than 10 hr but date and time must be after start counting time (indivisually too)

 

could sorted name then asc.order in order to understand what I described better.

NameAsc.orderDateRestStart counting timeEvent
John702-07-20 3:005:00 5:00
John201-07-20 2:008:00 8:00
John301-07-20 5:0012:0001-07-20 18:00 
Ron203-07-20 14:007:00 7:00
Ron303-07-20 17:004:00 4:00
Ron604-07-20 5:004:00 4:00
John401-07-20 10:003:10  
John501-07-20 19:007:00 7:00
John101-07-20 1:005:00 5:00
Ron403-07-20 20:002:00  
John902-07-20 11:002:00  
John1002-07-20 16:0015:0003-07-20 5:00 
John1103-07-20 17:005:00 5:00
John802-07-20 9:0011:0002-07-20 22:00 
John601-07-20 20:001:00  
Ron103-07-20 10:0012:0003-07-20 23:00 
Ron503-07-20 21:001:50  

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1596445485257.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous ,The information you have provided is not making the problem clear to me. Can you please explain with an example.
You table data is not making it clear
Appreciate your Kudos.

Anonymous
Not applicable

@amitchandak if you sort data with name and asc.order it will look like table below

 

NameAsc.orderDate                       Rest                           Start counting time                   Event
John101-07-20 1:005:00 5:00
John201-07-20 2:008:00 8:00
John301-07-20 5:0012:0001-07-20 18:00 
John401-07-20 10:003:10  
John501-07-20 19:007:00 7:00
John601-07-20 20:001:00  
John702-07-20 3:005:00 5:00
John802-07-20 9:0011:0002-07-20 22:00 
John902-07-20 11:002:00  
John1002-07-20 16:0015:0003-07-20 5:00 
John1103-07-20 17:005:00 5:00
Ron103-07-20 10:0012:0003-07-20 23:00 
Ron203-07-20 14:007:00 7:00
Ron303-07-20 17:004:00 4:00
Ron403-07-20 20:002:00  
Ron503-07-20 21:001:50  
Ron604-07-20 5:004:00 4:00

 

for start couting time column it will show date column plus 13 hr for rest over 10 hr indivisually

NameAsc.orderDate                       Rest                           Start counting time                   Event
John301-07-20 5:0012:0001-07-20 18:00 

 

for event column, it will display rest that more 3 hr but less than 10 hr for each row indivisually

but its date and time in date column must after lastest start counting time 

NameAsc.orderDate                       Rest                           Start counting time                   Event
John301-07-20 5:0012:0001-07-20 18:00 
John401-07-20 10:003:10  
John501-07-20 19:007:00 7:00
John601-07-20 20:001:00  
John702-07-20 3:005:00 5:00

roe 1 rest are more than 10 so start counting time are date column plus 13 hr (01-07-20 5:00 + 13 hr = 01-07-20 18:00)

row 2 rest are more than 3 and less than 10 but date and time is 01-07-20 10:00, its before 01-07-20 18:00 so its event column will blank

row 3,5 rest are more than 3 and less than 10 and date and time are after 01-07-20 18:00 so rest are shown in event column (7:00,5:00)

row 4 rest are less than 3 so event column will blank

Hi @Anonymous ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1596445485257.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.