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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.