DAX - IF value exist in related table

Viewed 16

I have two tables:

POHeader

POLines

In the POHeader table the PurchID is a unique value for each line, and I have a one-to-many relationship with PurchID in POLines.

Each PurchID in POHeader has a Status, which can be "Open order", "Received" or "Invoiced". The same goes for each line in POLines.

If all the lines with the same PurchID in POLines has status "Received", the PurchID in POHeader will also have status "Received". But if one line in POLines still has status "Open order" the status in POHeader for this PurchID will still be "Open order".

What I want to do is to create a calculated column in POHeader that check if a PurchID has status "Open order" in POHeader, and one line with the same PurchID, but status "Received" or "Invoiced" in POLines, which should then return the value "Partially received".

0 Answers
Related