Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
98 | |
75 | |
63 | |
62 |
User | Count |
---|---|
139 | |
104 | |
104 | |
80 | |
66 |