Forum Discussion
Simple IF statement returning incorrect results
- 2 years ago
Hi Pwilson460
I replicated your scenario and it works as it should :The pbix is attached, you can follow my steps
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Here is a table of sample data I have been using. I would expect all results labeled with "High Risk" to be negative from the following expression.
| Company Name | Sales Last 4 Weeks | Cash Last 4 Weeks | Variance | HighRisk_Under0 |
| AAA | $177,884 | $819 | ($177,065) | High Risk |
| BBB | $15,810 | $12,468 | ($3,341) | High Risk |
| CCC | $90,722 | $134,205 | $43,483 | High Risk |
| DD | $7,020 | $16,155 | $9,135 | High Risk |
| FFF | $16,155 | $24,660 | $8,505 | High Risk |
| GGG | $20,996 | $16,262 | ($4,734) | High Risk |
- Ritaf19832 years agoSuper User
Hi Pwilson460
I don't see the " NetLast4"...in this table...
Is the HighRisk_Under0 measure or calculated column...?It's still unclear what your data structure is and what you're trying to achieve.
- Pwilson4602 years agoNew Member
NetLast4 is the Sales last 4 weeks column, CashLast4 is the cash last 4 weeks column.
You are correct I misspoke, the HighRisk_Under0 is a calculated column.
- Ritaf19832 years agoSuper User
Hi Pwilson460
I replicated your scenario and it works as it should :The pbix is attached, you can follow my steps
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.