Forum Discussion
If Statement Total does not add up
- 2 years ago
Anonymous,
Here's an example you can adapt to your model. It evaluates the IF statement on a yearly basis. If you need it to evaluate at the day level, change "Year" to "Date".
calc = SUMX ( VALUES ( DateTable[Year] ), IF ( DateTable[Year] >= 2024, [USD_AP] - [USD_FC], [USD_AP] ) )Replace the hardcoded "2024" with the correct expression. I'm not sure what your table "A" is and how it's related to your model. The measure USD_AP has an incorrect total in your screenshot.
Anonymous,
Here's an example you can adapt to your model. It evaluates the IF statement on a yearly basis. If you need it to evaluate at the day level, change "Year" to "Date".
calc =
SUMX (
VALUES ( DateTable[Year] ),
IF ( DateTable[Year] >= 2024, [USD_AP] - [USD_FC], [USD_AP] )
)
Replace the hardcoded "2024" with the correct expression. I'm not sure what your table "A" is and how it's related to your model. The measure USD_AP has an incorrect total in your screenshot.
Worked for me. Spent a lot of time on this, thanks!