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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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