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

View all the Fabric Data Days sessions on demand. View schedule

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors