Forum Discussion
IF & AND Statement
RULE | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
I have a length, width and height in column A,B,C and column D has unit of dimension | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
I am trying to calculate volume in M3 based on the column D and dimension (length, width and height) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
If column D is CM,MM then convert to all of them as a M3. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
If column D is M then return as a M3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
If column D is 0 or blanks then return as a blanks | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
I am looking for new calculate column option in order to achieve my desired result
|
- Anonymous5 years ago
Hi Saxon10
use the below query as per your excel formula. If condition is good to use. Tweak your calculation as per your requirement. Plesae cehck, The formula doesn't need to devide by 1k if the UOM is "M"
_dimRes = IF(ISBLANK([UOM]),BLANK(), IF([UOM] = "CM", [L]*[W]*[H]/1000000,IF([UOM] = "MM", [L]*[W]*[H]/1000000000,IF([UOM] = "M", [L]*[W]*[H]/1000))))
6 Replies
- Saxon10Post Prodigy
I am trying to attempting switch function but I am receiving error. The data stored in number format expect unit of dimension.
Volume = SWITCH(VOLUME[UOM Dimension]="MM",VOLUME[Length]*VOLUME[Width]*VOLUME[Height]/1000000000,VOLUME[UOM Dimension]="CM",VOLUME[Length]*VOLUME[Width]*VOLUME[Height]/1000000) - Saxon10Post Prodigy
I am trying to attempting IF/AND function but I am receiving error.
- Jihwan_KimSuper User
Hi, Saxon10
Please correct me if I wrongly understood.
Can you try the below for your calculated column?
VolumeColumn =
SWITCH(TRUE(),VOLUME[UOM Dimension]="MM",VOLUME[Length]*VOLUME[Width]*VOLUME[Height]/1000000000,VOLUME[UOM Dimension]="CM",VOLUME[Length]*VOLUME[Width]*VOLUME[Height]/1000000)Jihwan Kim
If this post helps, then please consider accept it as the solution to help the other members find it more quickly.
- Saxon10Post Prodigy
I already tried this option and it will giva wrong results. Example length is 39, width is 23, height is 24 and unit of dimensions is MM then the above-mentioned DAx return 2.1528E-0 but actual output is 0.00021528. I believe maybe this is format issue.
- AnonymousNot applicable
Hi Saxon10
use the below query as per your excel formula. If condition is good to use. Tweak your calculation as per your requirement. Plesae cehck, The formula doesn't need to devide by 1k if the UOM is "M"
_dimRes = IF(ISBLANK([UOM]),BLANK(), IF([UOM] = "CM", [L]*[W]*[H]/1000000,IF([UOM] = "MM", [L]*[W]*[H]/1000000000,IF([UOM] = "M", [L]*[W]*[H]/1000))))- Saxon10Post Prodigy
Thank you so much for your help and advice. Your solution is working well.