Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
when date is maximum and status is closed return "close" for the shipment for all dates and if max date has "Open" as status return "Open" for all dates for that shipments.
eg:
Shipments | Date | Status | New Status |
A | 7-Oct | Open | Close |
A | 8-Oct | OPen | Close |
A | 9-Oct | Close | Close |
B | 7-Oct | Open | Open |
C | 7-Oct | Open | Close |
A | 6-Oct | Open | Open |
B | 8-Oct | Open | Open |
B | 9-Oct | Open | Open |
C | 8-Oct | Close | Close |
Solved! Go to Solution.
Hi @insandur
please try
New Status =
VAR CurrentShipmentTable =
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Shipments] ) )
VAR LastRecord =
TOPN ( 1, CurrentShipmentTable, 'Table'[Date] )
RETURN
MAXX ( LastRecord, 'Table'[Status] )
Hi,
Please check the below picture and the attached pbix file whether it suits your requirement.
New Status CC =
MAXX (
FILTER (
Data,
Data[Shipments] = EARLIER ( Data[Shipments] )
&& Data[Date]
= MAXX (
GROUPBY (
FILTER ( Data, Data[Shipments] = EARLIER ( Data[Shipments] ) ),
Data[Shipments],
"@maxdate", MAXX ( CURRENTGROUP (), Data[Date] )
),
[@maxdate]
)
),
Data[Status]
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
This worked, Thank you for quick response
Hi,
Please check the below picture and the attached pbix file whether it suits your requirement.
New Status CC =
MAXX (
FILTER (
Data,
Data[Shipments] = EARLIER ( Data[Shipments] )
&& Data[Date]
= MAXX (
GROUPBY (
FILTER ( Data, Data[Shipments] = EARLIER ( Data[Shipments] ) ),
Data[Shipments],
"@maxdate", MAXX ( CURRENTGROUP (), Data[Date] )
),
[@maxdate]
)
),
Data[Status]
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
Hi @insandur
please try
New Status =
VAR CurrentShipmentTable =
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Shipments] ) )
VAR LastRecord =
TOPN ( 1, CurrentShipmentTable, 'Table'[Date] )
RETURN
MAXX ( LastRecord, 'Table'[Status] )
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |