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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
rpinxt
Solution Sage
Solution Sage

Get Max date for every delivery. Calculated column?

rpinxt_0-1668008450196.png

This is the situation:

A delivery with several log dates.

I linked log date to my date table to get it in periods.

 

Because there are 2 log dates (in this case. many times even more) this delivery will pop up in 2 periods.

I want it to only pop up in the latest period.

 

So I was thinking create a calculated column to get the max date for every delivery.

In this case both lines should get date 2-1-22.

 

That column I would then link to my date table instead of the column Log Date.

So in that way the delivery should only show up in 1 period.

 

Would this the best way?

And if yes how what that calculated column look?
Guess max([log date]) will not be enought because it has to reset at every delivery number.

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

HI @rpinxt,

You can try to use the EARLIER function with iterator function MAXX to get the max date based on current field values and use it as formula conditions.

newColumn =
MAXX ( FILTER ( Table, [delivery] = EARLIER ( Table[delivery] ) ), [log date] )

EARLIER vs EARLIEST in DAX - Excelerator BI

Regards,

Xiaoxin Sheng

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula will work

Revised log date = calculate(max(Data[Log date]),filter(Data,Data[Delivery]=earlier(Data[Delivery])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
rpinxt
Solution Sage
Solution Sage

Thanks @Ashish_Mathur @Anonymous !

 

Both your solutions worked like a charm :

rpinxt_0-1668077316292.png

And if I then take out log date it consolidates to 1 line with only the 10 in period 2 as I wanted 😄

rpinxt_1-1668077371805.png

 

Thanks again guys! Very helpful

Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula will work

Revised log date = calculate(max(Data[Log date]),filter(Data,Data[Delivery]=earlier(Data[Delivery])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

HI @rpinxt,

You can try to use the EARLIER function with iterator function MAXX to get the max date based on current field values and use it as formula conditions.

newColumn =
MAXX ( FILTER ( Table, [delivery] = EARLIER ( Table[delivery] ) ), [log date] )

EARLIER vs EARLIEST in DAX - Excelerator BI

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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