Forum Discussion
Measure with multiple dates & an exception
- 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] ) )- PBIX12343 years agoFrequent Visitor
tamerj1 ,
Thank you - it did return the correct result but when I tested another sample dataset it was not correct. I am also concerned about using ALL(Contracts), as this will remove the ability to filter by Category later down the track for example.
I have a new sample dataset here, it may be clearer. Can you please perhaps have another look?
Appreciate your help!
Thanks 🙂