Forum Discussion
Convert formula to power query
Dears,
I need your support to help me transform the formula below to PQ format:
IF(AND([col1]<=50,[col1]>=0),"28.3",IF(AND([col1]>=51,[col1]<=75),"33.55",IF(AND([col1]<=100,[col1]>=76),"38.8",IF(AND([col1]>=101,[col1]<=200),"61.6",IF(AND([col1]>=201,[col1]<=400),"85.6",IF(AND([col1]>=401,[col1]<=500),"95.2",IF(AND([col1]>=501,[col1]<=700),"115.6",IF(AND([col1]>=701,[col1]<=900),"184.9","234.4"))))))))
Thanks
- Anonymous5 years ago
Hi Anonymous ,
You can add conditional columns.
Or add a custom column.
if [col1] <= 50 and [col1] >= 0 then "28.3" else if [col1]>= 51 and [col1] <= 75 then "33.55" else if [col1] <= 100 and [col1] >= 76 then "38.8" else if [col1] >= 101 and [col1] <= 200 then "61.6" else if [col1] >= 201 and [col1] <= 400 then "85.6" else if [col1] >= 401 and [col1] <= 500 then "95.2" else if [col1] >= 501 and [col1] <= 700 then "115.6" else if [col1] >= 701 and [col1] <= 900 then "184.9" else "234.4"Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- AnonymousNot applicable
Hi Anonymous ,
You can add conditional columns.
Or add a custom column.
if [col1] <= 50 and [col1] >= 0 then "28.3" else if [col1]>= 51 and [col1] <= 75 then "33.55" else if [col1] <= 100 and [col1] >= 76 then "38.8" else if [col1] >= 101 and [col1] <= 200 then "61.6" else if [col1] >= 201 and [col1] <= 400 then "85.6" else if [col1] >= 401 and [col1] <= 500 then "95.2" else if [col1] >= 501 and [col1] <= 700 then "115.6" else if [col1] >= 701 and [col1] <= 900 then "184.9" else "234.4"Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- ImkeFCommunity Champion
Hi Anonymous ,
the syntax has the following pattern:
if [col1] <= 50 and [col1] >= 0 then "28.3" else if ....