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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Ericwhv
Helper II
Helper II

Dax - Compare two or more row of data, and show the MIN one

Hi All

 

Thank you for your help in advance first.

 

I have below Table.

HB is not an unquie number

Master is unquie number

 

I want to show the row of data with earliest COB 

i am not sure how can i do that, not sure if anyone could help me?

 

Raw Data:

HBMasterCOBOrigin
4411255ABC1234512-AugMAD
4411255CDE5432115-AugHKG
556677ABD1234512-AugMAD
337788UIZ5678911-AugLHR
667788KIL1234511-AugWAW
667788POI5566712-AugFRA
667788UYE9977813-AugCDG

 

Ideal Result

HBOrigin
4411255MAD
556677MAD
337788LHR
667788WAW

 

Thank you!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Ericwhv , I have blog for latest value, You can try the same with min for min value

 

https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

 

Last Status = var _max = minx(filter(ALLSELECTED(Data), Data[HB] = Max(Data[HB])), Data[COD]) 
return 
CALCULATE(max(Data[Origin]), filter((Data) ,  Data[Date] =_max))
Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Ericwhv , I have blog for latest value, You can try the same with min for min value

 

https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

 

Last Status = var _max = minx(filter(ALLSELECTED(Data), Data[HB] = Max(Data[HB])), Data[COD]) 
return 
CALCULATE(max(Data[Origin]), filter((Data) ,  Data[Date] =_max))
Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi Amit

 

sorry for asking again, if i would like to add one more criteria, is it possible?

shall we check if leg check column has a "Last leg" or not?
if there is a "Last Leg", then show that HB
if there are empty or no "Last Leg" exist, then keep the same logic before.

 

thank you.

 

Raw Data:

HBMasterCOB

Origin

Leg Check

4411255ABC12345 MADLast Leg
4411255CDE5432115-AugHKGFirst Leg
556677ABD1234512-AugMAD 
337788UIZ5678911-AugLHR 
667788KIL1234511-AugWAWLast Leg
667788POI5566712-AugFRA 
667788UYE9977813-AugCDG 

 

Ideal Result

HBOrigin 
4411255MADLast Leg
556677MAD 
337788LHR 
667788WAW 

Thank you Amit!
you help me again!
it is work and the porblem sorted.

but could you mind to go through with me why that is work?
I want to know how to fishing instead of keep asking fish from you lol

Thank you so much!!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.