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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
pmadam
Helper II
Helper II

DAX Help

From below screenshot how do i get  col_orderstatus of max col_orderid number for same col_tnumber

 

Hlp.jpg

 

Thanks,

Prathy

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @pmadam ,

 

Please try the below measure, it works on my desktop:

 

 

CALCULATE(MAX('Table (5)'[Status]),FILTER('Table (5)','Table (5)'[Orderid] = CALCULATE(MAX('Table (5)'[Orderid]),ALLEXCEPT('Table (5)','Table (5)'[Number]))))

 

 

DAX Help.PNG

 

Aiolos Zhao

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @pmadam ,

 

Please try the below measure, it works on my desktop:

 

 

CALCULATE(MAX('Table (5)'[Status]),FILTER('Table (5)','Table (5)'[Orderid] = CALCULATE(MAX('Table (5)'[Orderid]),ALLEXCEPT('Table (5)','Table (5)'[Number]))))

 

 

DAX Help.PNG

 

Aiolos Zhao

Ashish_Mathur
Super User
Super User

Hi,

Try these measure

max_orderid = calculate(max(data[col_orderid]),allexcept(data,data[col_orderstatus]))

order_status of max order id = if(hasonevalue(data[col_tnumber]),lookupvalue(data[col_orderstatus],data[col_tnumber],values(data[col_tnumber]),data[col_orderid],[max_orderid]),blank())

Drag the second measure to your visual.

Hope this helps.


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

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors