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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
AiolosZhao
Memorable Member
Memorable Member

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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
AiolosZhao
Memorable Member
Memorable Member

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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.