Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I want to get 2 tables below and they are link by SO #. I want to get the CS No. with the highest POS # where Code = 'ZC'.
I am trying to use lookup table but seems not working. Can anyone advise ? Thank you!
Hi @SBGoh
I don't quite understand what you mean by you want to get 2 tables. If you're trying to get the CS No in Partner wherein the POS # is the max for each POS # and which SO # is equal to the current row in SO # in Sales Order, you can try either of these:
=
CALCULATE (
MAX ( Partner[CS No.] ),
FILTER (
Partner,
VAR MaxPO =
CALCULATE ( MAX ( Partner[POS #] ), ALLEXCEPT ( Partner, Partner[SO #] ) )
RETURN
Partner[SO No] = EARLIER ( SalesOrder[SO N#] )
&& Partner[POS #] = MaxPO
&& Partner[Code] = "ZC"
)
)
=
VAR MaxPO =
CALCULATE (
MAX ( Partner[POS #] ),
FILTER ( Partner, Partner[SO #] = EARLIER ( SalesOrder[SO N#] ) )
)
RETURN
CALCULATE (
MAX ( Partner[CS No.] ),
FILTER (
Partner,
Partner[SO No] = EARLIER ( SalesOrder[SO N#] )
&& Partner[POS #] = MaxPO
&& Partner[Code] = "ZC"
)
)
Otherwise, please post a sample data that we can copy-paste (not an image).
Proud to be a Super User!
Hi, may I know what is the purpose of 'Earlier"? I try to read the explanation from Microsoft but I don't seems to understand. What if I don't use "Earlier"?
If my CS No. contain text like "P1234", can I still use "MAX" ?
Hi, I have a Sales Order with SO # = 1900 with a list of 3 partners records. (The 2 tables are link by SO #).
The Code = 'ZC' refers to CS executive and there are 2 CS. I only want to display 1 CS record with highest POS #. In this case is the blue highlighed record with Code = 'ZC' and POS # = 0011 and CS No. = 2244.
Partner table
SO # | POS # | Code | CS No. |
1900 | 0000 | VE | 1234 |
1900 | 0011 | ZC | 2244 |
1900 | 0000 | ZC | 3355 |
Sales Order table
SO # | POS # | Material |
1900 | 0011 | PartNum 1 |
1900 | 0022 | PartNum 2 |
Please check the formulas i inititally provided. Either one should work.
Proud to be a Super User!
User | Count |
---|---|
101 | |
90 | |
78 | |
70 | |
69 |
User | Count |
---|---|
110 | |
96 | |
95 | |
74 | |
71 |