Forum Discussion
PBIX1234
3 years agoFrequent Visitor
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...
- PBIX12343 years agoFrequent Visitor
tamerj1 , technically the result on the sample file is correct, all should be "contracted". However, it is not calculating correctly, as the current measures don't account for "if active after expiry date". Hence, 2021 should show as unconctracted without the exception.
I started a new measure called "Contracted Amount (2)" to compare with - this is what I need the formula help with.Thank you 🙂
- tamerj13 years ago
Community Champion
PBIX1234
Please check this measure and let me know if this is what you want.Contracted Amount (2) = SUMX ( ALL ( CONTRACTS ), SUMX ( FILTER ( SPEND, SPEND[NAME] = CONTRACTS[NAME] && SPEND[DATE] >= CONTRACTS[START] && OR ( SPEND[DATE] <= COALESCE ( CONTRACTS[EXPIRY], TODAY ( ) ), CONTRACTS[STATUS] = "Active" ) ), SPEND[AMOUNT] ) )