The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi all
Struggling to write a DAX column for this.
I have two tables:
Order table
Order ID | ... |
101 | ... |
102 | ... |
Order status history
Order ID | Date | Status |
101 | 1/1/23 | Order placed |
101 | 1/1/23 | On hold |
101 | 1/1/23 | Paid |
101 | 1/1/23 | Dispatched |
102 | 1/1/23 | Order placed |
102 | 1/1/23 | Paid |
102 | 1/1/23 | Dispatched |
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!!
Solved! Go to Solution.
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.
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.
User | Count |
---|---|
14 | |
12 | |
7 | |
6 | |
5 |
User | Count |
---|---|
28 | |
18 | |
13 | |
7 | |
5 |