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! Request now

Reply
metcala
Helper III
Helper III

Check if an order has previously been in order status

Hi all

 

Struggling to write a DAX column for this.

 

I have two tables:

 

Order table

Order ID...
101...
102...

 

Order status history

Order IDDateStatus
1011/1/23Order placed
1011/1/23On hold
1011/1/23Paid
1011/1/23Dispatched
1021/1/23Order placed
1021/1/23Paid
1021/1/23Dispatched

 

I am looking to create a column in the order table to highlight if the order has ever been placed on hold irrespective of current status.

 

Any help on this would be very much appreciated!!

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

If there's a relationship between Order and the history, then you can try something like:

OnHold = COUNTROWS(FILTER(RELATEDTABLE('Order Status History'), 'Order Status History'[Status] = "On Hold")))

 this should be 0 if it's never been placed on hold, and a number >0 if it has.

View solution in original post

2 REPLIES 2
vicky_
Super User
Super User

If there's a relationship between Order and the history, then you can try something like:

OnHold = COUNTROWS(FILTER(RELATEDTABLE('Order Status History'), 'Order Status History'[Status] = "On Hold")))

 this should be 0 if it's never been placed on hold, and a number >0 if it has.

Thanks for your help! @vicky_ 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.