RICH937
Board Regular
- Joined
- Apr 15, 2023
- Messages
- 59
- Office Version
- 365
- Platform
- Windows
- Mobile
Hi Everyone,
I am hoping this is an easy request for the PowerQuery users on here. I am trying to translate a simple simple excel filter function with multiple criteria like D2=FILTER(A2:A13, ((B2:B13=@B2) * (C2:C13="BLUE")))into a PQE formula. My goal is to be able to create basically the orange section below in PQE where values in columns are transposed to values in columns filtered for some criteria so I can do calculations on each entire row using the both the original and filtered data (last 4 columns). What I cannot figure out is how to write the cell reference like [@[PROD CLASS]] portion of the formula. FILTER([OH QTY],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="BERMUDA"))).
I have looked for a solution here, on other boards, YT in M is for Data Monkey, Reddit, etc., and can't find anything. As it's a relatively common formula, and referencing a cell in a column like (@B2) is even more common, my bet is I am simply not using the correct search terms. I have tried pivot/group/unpivot, Table.SelectRows, and then Table.SelectRows along with an index and Table.ToList which seems like they should work, but nothing seems to work.
Can anyone help me translate this? If it's easier than doing the entire table below, just how to write: H3= FILTER([OH QTY],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="BERMUDA"))) will most likely do the trick.
I've spent at least two days trying different things on this one, and nothing works so I'm throwing in the DIY towel.
Thank you,
Rich
I am hoping this is an easy request for the PowerQuery users on here. I am trying to translate a simple simple excel filter function with multiple criteria like D2=FILTER(A2:A13, ((B2:B13=@B2) * (C2:C13="BLUE")))into a PQE formula. My goal is to be able to create basically the orange section below in PQE where values in columns are transposed to values in columns filtered for some criteria so I can do calculations on each entire row using the both the original and filtered data (last 4 columns). What I cannot figure out is how to write the cell reference like [@[PROD CLASS]] portion of the formula. FILTER([OH QTY],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="BERMUDA"))).
I have looked for a solution here, on other boards, YT in M is for Data Monkey, Reddit, etc., and can't find anything. As it's a relatively common formula, and referencing a cell in a column like (@B2) is even more common, my bet is I am simply not using the correct search terms. I have tried pivot/group/unpivot, Table.SelectRows, and then Table.SelectRows along with an index and Table.ToList which seems like they should work, but nothing seems to work.
Can anyone help me translate this? If it's easier than doing the entire table below, just how to write: H3= FILTER([OH QTY],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="BERMUDA"))) will most likely do the trick.
I've spent at least two days trying different things on this one, and nothing works so I'm throwing in the DIY towel.
Thank you,
Rich
P003 Baysian Source Paretos FINAL.xlsx | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | |||
2 | PROD_ID | PROD CLASS | SUBTYPE | CATEGORY | OH QTY | LIST/UNIT | BULK PROMO | BERM QTY | BLUE QTY | LEM QTY | ZOY QTY | BERM LSP | BLUE LSP | LEM LSP | ZOY LSP | BERM DIS | BLUE DIS | LEM DIS | ZOY DIS | TTL VOL | TTL VALUE | SUB % VOL | SUB % VALUE | ||
3 | G-1 | GRASS-1 | BERMUDA | SEED (BAG) | 50 | $250 | 20% | 50 | 100 | 15 | 45 | $250 | $75 | $225 | $750 | 20% | 12% | 15% | 18% | 210 | $57,125 | 23.8% | 21.9% | ||
4 | G-1 | GRASS-1 | ZOYSIA | SEED (BAG) | 45 | $750 | 18% | 50 | 100 | 15 | 45 | $250 | $75 | $225 | $750 | 20% | 12% | 15% | 18% | 210 | $57,125 | 21.4% | 59.1% | ||
5 | G-2 | GRASS-2 | BLUE | PLANT (FLAT) | 5 | $25 | 15% | 10 | 5 | 20 | 10 | $30 | $25 | $10 | $50 | 10% | 15% | 7% | 9% | 45 | $1,125 | 11.1% | 11.1% | ||
6 | G-1 | GRASS-1 | LEMON | SEED (BAG) | 15 | $225 | 15% | 50 | 100 | 15 | 45 | $250 | $75 | $225 | $750 | 20% | 12% | 15% | 18% | 210 | $57,125 | 7.1% | 5.9% | ||
7 | G-1 | GRASS-1 | BLUE | SEED (BAG) | 100 | $75 | 12% | 50 | 100 | 15 | 45 | $250 | $75 | $225 | $750 | 20% | 12% | 15% | 18% | 210 | $57,125 | 47.6% | 13.1% | ||
8 | G-2 | GRASS-2 | BERMUDA | PLANT (FLAT) | 10 | $30 | 10% | 10 | 5 | 20 | 10 | $30 | $25 | $10 | $50 | 10% | 15% | 7% | 9% | 45 | $1,125 | 22.2% | 26.7% | ||
9 | G-2 | GRASS-2 | ZOYSIA | PLANT (FLAT) | 10 | $50 | 9% | 10 | 5 | 20 | 10 | $30 | $25 | $10 | $50 | 10% | 15% | 7% | 9% | 45 | $1,125 | 22.2% | 44.4% | ||
10 | G-2 | GRASS-2 | LEMON | PLANT (FLAT) | 20 | $10 | 7% | 10 | 5 | 20 | 10 | $30 | $25 | $10 | $50 | 10% | 15% | 7% | 9% | 45 | $1,125 | 44.4% | 17.8% | ||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
H3:H10 | H3 | =FILTER([OH QTY],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="BERMUDA"))) |
I3:I10 | I3 | =FILTER([OH QTY],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="BLUE"))) |
J3:J10 | J3 | =FILTER([OH QTY],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="LEMON"))) |
K3:K10 | K3 | =FILTER([OH QTY],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="ZOYSIA"))) |
L3:L10 | L3 | =FILTER([LIST/UNIT],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="BERMUDA"))) |
M3:M10 | M3 | =FILTER([LIST/UNIT],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="BLUE"))) |
N3:N10 | N3 | =FILTER([LIST/UNIT],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="LEMON"))) |
O3:O10 | O3 | =FILTER([LIST/UNIT],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="ZOYSIA"))) |
P3:P10 | P3 | =FILTER([BULK PROMO],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="BERMUDA"))) |
Q3:Q10 | Q3 | =FILTER([BULK PROMO],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="BLUE"))) |
R3:R10 | R3 | =FILTER([BULK PROMO],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="LEMON"))) |
S3:S10 | S3 | =FILTER([BULK PROMO],(([PROD CLASS]=[@[PROD CLASS]])*([CATEGORY]=[@CATEGORY])*([SUBTYPE]="ZOYSIA"))) |
T3:T10 | T3 | =SUM(CTC_TEST_CODE[@[BERM QTY]:[ZOY QTY]]) |
U3:U10 | U3 | =([@[BERM QTY]]*[@[BERM LSP]])+([@[BLUE QTY]]*[@[BLUE LSP]])+([@[LEM QTY]]*[@[LEM LSP]])+([@[ZOY QTY]]*[@[ZOY LSP]]) |
V3:V10 | V3 | =[@[OH QTY]]/[@[TTL VOL]] |
W3:W10 | W3 | =([@[OH QTY]]*[@[LIST/UNIT]])/[@[TTL VALUE]] |
A3:A10 | A3 | ="G-"&(TEXTAFTER([@[PROD CLASS]],"-")) |