If statement with Truncated value as part of calc

gazmoz17

Board Regular
Joined
Sep 18, 2020
Messages
158
Office Version
  1. 365
Platform
  1. Windows
Hi,

New to power query need to do the above. So add a column which is the result of that statement and then filter the query on new custom column.

This is the working formula in excel table:

=IF(_20[@UoM]="ea",0,IF((_20[@QTY]/_20[@Weight])-TRUNC(_20[@QTY]/_20[@Weight])=0,0,1))

Wish to filter on value 1.

Basically this query highlights an inv keying error, we sell some prods out in kgs others each ("ea"). For prods we sell in kgs this query is a control to highlight when we have a kg qty which is not a multiple of its weight, then its a keying error or weve accidentally keyed kg value for product which is sold out as Each (e.g. complete unit) but customer would twig that as the inv value would be huge 😆.

Pretty sure I can do it in power query by creating 2 separate custom columns (orange and green) then wrote my if refs these 2 columns. But wish to know how to use with Truncate.

I'm fine applying the filter but second question is it necessarily for me to create a custom column to then filter or can I save this as an expression etc (no not correct term) in background and filter on it?

Many Thanks
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,223,655
Messages
6,173,610
Members
452,522
Latest member
saeedfiroozei

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top