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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Hranjan
Regular Visitor

Get value of latest order # in a column

Hi,

 

I want to create a new column which only shows the 'Order #' value for the latest 'Order Date'.

 

For example, for opportunity 977A, I want the new column to show the value 'T000210443' since that has the latest date for 977A. I would prefer the cells with older dates associated to them to remain blank.

 

 

Data SampleData Sample

 

Thank you in advance!

1 ACCEPTED SOLUTION
nilimarodrigues
Helper III
Helper III

Hello,

 

I tried to solve this problem by creating a new column for MAX-ORDER.

Below is the approach, I took:

1> In query editor, create a reference table of that of your original table. In my case, I created SAMPLE-COPY as reference of SAMPLE.

2> Then, apply Group by function as shown in screenshot.

pbi3.PNG

 

3> In relationship view, join these two tables based on either ORDER number or DATE field:

pbi4.PNG

4> Then in the main table (in my case: SAMPLE), then add new column called "MAX-ORDER" by using RELATED function:

pbi5.PNG

You can then hide original ORDER column and just keep using MAX-ORDER column. 

View solution in original post

2 REPLIES 2
nilimarodrigues
Helper III
Helper III

Hello,

 

I tried to solve this problem by creating a new column for MAX-ORDER.

Below is the approach, I took:

1> In query editor, create a reference table of that of your original table. In my case, I created SAMPLE-COPY as reference of SAMPLE.

2> Then, apply Group by function as shown in screenshot.

pbi3.PNG

 

3> In relationship view, join these two tables based on either ORDER number or DATE field:

pbi4.PNG

4> Then in the main table (in my case: SAMPLE), then add new column called "MAX-ORDER" by using RELATED function:

pbi5.PNG

You can then hide original ORDER column and just keep using MAX-ORDER column. 

Thank you so much! I have learned something new today! 😀

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 Kudoed Authors