Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
rupa1006
Frequent Visitor

Hi all ,i have a requirement below and getting argument 4 lookup value required


if (custoemr is in A table AND if the BU type is not "UT", "DT", "PT") or if customer number = 5150
then = 'In' else 'OUT'

 

INOUT=
IF (
OR (
AND (
NOT ISBLANK (
LOOKUPVALUE (
'ASP vw_A'[businessUnitName],
'ASP vw_A'[businessUnitNumber],
'ASP vw_B'[CustomerNumber]
)
),
NOT OR (
SELECTEDVALUE('ASP vw_A'[BU Type]) IN {"UT", "DT", "PT"}
)
),
'ASP vw_B'[CustomerNumber] = 5150
),
"IN",
"OUT"
)

 

1 ACCEPTED SOLUTION
123abc
Super User
Super User

 

Here's the corrected version of your code:

 

INOUT =
IF (
OR (
AND (
NOT ISBLANK (
LOOKUPVALUE (
'ASP vw_A'[businessUnitName],
'ASP vw_A'[businessUnitNumber],
'ASP vw_B'[CustomerNumber]
)
),
NOT OR (
SELECTEDVALUE('ASP vw_A'[BU Type]) IN {"UT", "DT", "PT"}
)
),
'ASP vw_B'[CustomerNumber] = 5150
),
"IN",
"OUT"
)

 

 

In this code, I've corrected the LOOKUPVALUE function to use the correct syntax. The first argument of LOOKUPVALUE is the column that contains the values you want to retrieve, and the second argument is the column used for matching. Make sure you replace 'ASP vw_A'[businessUnitName] with the actual column you want to retrieve values from and 'ASP vw_A'[businessUnitNumber] with the column used for matching.

If you're still facing issues, please provide more details or context about the tables and columns you're working with, and I'll do my best to assist you.

View solution in original post

1 REPLY 1
123abc
Super User
Super User

 

Here's the corrected version of your code:

 

INOUT =
IF (
OR (
AND (
NOT ISBLANK (
LOOKUPVALUE (
'ASP vw_A'[businessUnitName],
'ASP vw_A'[businessUnitNumber],
'ASP vw_B'[CustomerNumber]
)
),
NOT OR (
SELECTEDVALUE('ASP vw_A'[BU Type]) IN {"UT", "DT", "PT"}
)
),
'ASP vw_B'[CustomerNumber] = 5150
),
"IN",
"OUT"
)

 

 

In this code, I've corrected the LOOKUPVALUE function to use the correct syntax. The first argument of LOOKUPVALUE is the column that contains the values you want to retrieve, and the second argument is the column used for matching. Make sure you replace 'ASP vw_A'[businessUnitName] with the actual column you want to retrieve values from and 'ASP vw_A'[businessUnitNumber] with the column used for matching.

If you're still facing issues, please provide more details or context about the tables and columns you're working with, and I'll do my best to assist you.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.