Forum Discussion
Measure with multiple dates & an exception
Hi, I am working with a model that has two fact tables joined by some shared dimensions.
The fact tables are our payments named SPEND (top left) and contract records named CONTRACTS (bottom right)
They are joined by Date & Supplier that are common, as well as Categories which has some mapping.
Screenshot of the model;
I am trying to create a measure for Contracted Spend. The conditions are;
Contracted Amount =
Sum of SPEND(Amount)
Occurs after CONTRACTS(Start)
AND
Occurs before CONTRACTS(End) ... *UNLESS the CONTRACTS(Status) is "Active"
*The last condition is to account for contracts that are expired but rolling on terms - this is how our system tracks it.
I tried first getting the result excluding the exception of active contracts after expiry, but still didn't get the desired result;
How would this formula be phrased?