Forum Discussion
Simple Multi IF then statement help please :-)
- 7 years ago
Hi unclejemima,
From your description, I create sample data to reproduce the scenario. For your reply above, the reason getting error message is missing comma as picture below.
To work around the issue, you can create column named "Divide-1" and measure named "Qty-LowStock-Warning" using multi IF then statement to implement your demand.
Divide-1 = DIVIDE(Inventry[Qty-Avail],Inventry[Low])-1
Qty-LowStock-Warning =
IF(SUM('Inventry'[Divide-1]) >= 0 && SUM('Inventry'[Divide-1]) <= 0.25,
"Low Stock",
IF(SUM('Inventry'[Divide-1]) < 0,
"Low Stock WARNING",
blank())
)
Choose table visual to display the result showing picture below.
Here is my test pbix file link: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EU8iDDYMpadMpAqL1VjTSpUBd5QXVeQsh9PwRxJLFhb2wQ?e=FcQIxS
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ok, here is my actual example...it looks like it should work but I'm getting a "The syntax for "Low Stock Warning" is incorrect,
Is this because I can't use a text result for this? Here is my formula...
Qty-LowStock-Warning = IF(Inventry[Qty-Avail]/Inventry[Low]-1 >= 0 && Inventry[Qty-Avail]/Inventry[Low]-1 <= 0.25, "Low Stock", IF(Inventry[Qty-Avail]/Inventry[Low]-1 < 0 "Low Stock WARNING", blank()) )
Anyone? :-)
- v-xicai7 years agoCommunity Support
Hi unclejemima,
From your description, I create sample data to reproduce the scenario. For your reply above, the reason getting error message is missing comma as picture below.
To work around the issue, you can create column named "Divide-1" and measure named "Qty-LowStock-Warning" using multi IF then statement to implement your demand.
Divide-1 = DIVIDE(Inventry[Qty-Avail],Inventry[Low])-1
Qty-LowStock-Warning =
IF(SUM('Inventry'[Divide-1]) >= 0 && SUM('Inventry'[Divide-1]) <= 0.25,
"Low Stock",
IF(SUM('Inventry'[Divide-1]) < 0,
"Low Stock WARNING",
blank())
)
Choose table visual to display the result showing picture below.
Here is my test pbix file link: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EU8iDDYMpadMpAqL1VjTSpUBd5QXVeQsh9PwRxJLFhb2wQ?e=FcQIxS
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- unclejemima7 years agoPost Patron
Hey that should work. I'll give it a go!
- unclejemima7 years agoPost Patron
Thank you!!!! One silly comma. Very much apprecaite your help!!! Marked as solved! :-)