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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Pick
Helper II
Helper II

New table command to get start and end time for rows based on 2 columns

Hi,

 

I have a table below also with a time column.  I want to create a new table which will check every ID WITHIN every Order_No with two new columns showing the first Start data/time for each ID WITHIN each Order_No and one for the End date/time of the last status change.  I also want the table to have Order_no, Phase, Control strategy columns.  Need to ensure ORder_No is used as the ID can be the same within each Order_No

table.JPG

 Any help greatly appreciated.

 

 

Thanks

2 REPLIES 2
amitchandak
Super User
Super User

Can you give an example of the output you need?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

HI thanks for the reply.

 

Like the below, but this table i created searches for the ID only and I need to used each OrderNo first to find the start and last time of the ID within each order.  Below its basically got the eaerliest ID regardless of OrderNo.

 

Command used was:

PCS7_PHASE_GANNT = SUMMARIZE ( 'PCS7_PHASES_VIEW', 'PCS7_PHASES_VIEW'[Order_No],
'PCS7_PHASES_VIEW'[Product_Code], 'PCS7_PHASES_VIEW'[Product_Name], 'PCS7_PHASES_VIEW'[ID],
'PCS7_PHASES_VIEW'[Organizational_Unit], 'PCS7_PHASES_VIEW'[Unit], 'PCS7_PHASES_VIEW'[Phase],
'PCS7_PHASES_VIEW'[CONTROL_STRATEGY],
"A", CALCULATE ( MIN ( 'PCS7_PHASES_VIEW'[Updated_At] ), FILTER ( ALL('PCS7_PHASES_VIEW'), 'PCS7_PHASES_VIEW'[ID] = EARLIER ( 'PCS7_PHASES_VIEW'[ID] ) ) ),
"B", CALCULATE ( MAX ( 'PCS7_PHASES_VIEW'[Updated_At] ), FILTER ( ALL('PCS7_PHASES_VIEW'), 'PCS7_PHASES_VIEW'[ID] = EARLIER ( 'PCS7_PHASES_VIEW'[ID] ) ) ) )

 

table1.JPG

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 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