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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
StaceyG
Helper I
Helper I

Lookup latest date

Hello all you brilliant minds!

 

I have two tables, on has a single row per Opportunity, including the Opportunity ID and current Stage Name.  The other has the Stage History, multiple rows per Opportunity ID, with Stage Name and date of Stage change.

 

I created a column in each table which concatenates the Opportunity ID and Stage (as OpIDStage), so that I can lookup the date value in the Stage History table and include it in the Opportunity table.  However, there are cases where the stage was regressed, so there are multiple rows including the same OpIDStage.  How can I lookup only the latest date for the corresponding OpIDStage?

 

 

 

OpIDStage.png

Thanks for your help!

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@StaceyG 

Assuming the tables are joined like this.

jdbuchanan71_0-1621271967706.png

Give something like this a try.

Latest Date = CALCULATE( MAX ( 'Stage History'[Date] ) )

jdbuchanan71_1-1621272011857.png

 

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@StaceyG 

Assuming the tables are joined like this.

jdbuchanan71_0-1621271967706.png

Give something like this a try.

Latest Date = CALCULATE( MAX ( 'Stage History'[Date] ) )

jdbuchanan71_1-1621272011857.png

 

 

@jdbuchanan71  that worked!  Thanks so much for your help!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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